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:
2026-06-11 00:02:02 +09:00
parent 1bfad8332c
commit f7d84b4f0f
3 changed files with 6 additions and 9 deletions
+3 -5
View File
@@ -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