fix(tech): preserve h1 elements — do not strip first heading
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -60,15 +60,14 @@ tags:
|
||||
|
||||
## Body
|
||||
|
||||
Plain markdown. The renderer strips the first-line `# Heading` if present (it duplicates the wiki page title), then passes the body through Pandoc.
|
||||
Plain markdown. The body is passed through Pandoc as-is — the first-line `# Heading` is not stripped, so you can use h1 elements freely.
|
||||
|
||||
## Renderer behaviour
|
||||
|
||||
For each `.md` with `wiki.publish: true`:
|
||||
|
||||
1. Parse and validate frontmatter.
|
||||
2. Strip the leading `# Heading` from the body if present.
|
||||
3. Pipe the body through `pandoc -f markdown -t mediawiki`.
|
||||
2. Pipe the body through `pandoc -f markdown -t mediawiki`.
|
||||
4. Prepend the auto-generated banner: `{{Auto-generated|source=<source URL>|commit=<sha>}}`.
|
||||
5. Append category tags: `[[Category:Tech blog]]`; `[[Category:Blog:<year>]]` if `date` is set; `[[Category:<tag>]]` for each tag.
|
||||
6. Read the current wiki page content; if identical, skip the write (idempotency).
|
||||
@@ -78,8 +77,7 @@ For each `.md` with `wiki.publish: true`:
|
||||
## Implemented scope
|
||||
|
||||
- Frontmatter parsing and validation
|
||||
- Pandoc-based markdown → wikitext rendering
|
||||
- First-line h1 stripping
|
||||
- Pandoc-based markdown → wikitext rendering (h1 elements preserved)
|
||||
- Banner template injection
|
||||
- `Category:Tech blog` on every published page
|
||||
- `Category:Blog:<year>` from `date` field
|
||||
|
||||
Reference in New Issue
Block a user