fix(tech): default Blog year category to execution year
Dateless posts silently lost their Blog:<year> category. build_wikitext now falls back to datetime.now().year when no date is declared, so every published post lands in a year category. Docs corrected accordingly. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -45,7 +45,7 @@ wiki:
|
||||
|
||||
#### `date` (ISO 8601 date)
|
||||
|
||||
Publication date in `YYYY-MM-DD` format. Drives `[[Category:Blog:<year>]]` injection. If omitted, no year category is added.
|
||||
Publication date in `YYYY-MM-DD` format. Drives `[[Category:Blog:<year>]]` injection. If omitted, the year falls back to the time the publish action runs.
|
||||
|
||||
#### `tags` (list of strings)
|
||||
|
||||
@@ -69,7 +69,7 @@ For each `.md` with `wiki.publish: true`:
|
||||
1. Parse and validate frontmatter.
|
||||
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.
|
||||
5. Append category tags: `[[Category:Tech blog]]`; `[[Category:Blog:<year>]]` (from `date`, or the action's execution year if `date` is absent); `[[Category:<tag>]]` for each tag.
|
||||
6. Read the current wiki page content; if identical, skip the write (idempotency).
|
||||
7. If the page exists without `{{Auto-generated`, skip with a warning (manual page protection).
|
||||
8. Otherwise, write with an edit summary referencing the source commit.
|
||||
@@ -80,7 +80,7 @@ For each `.md` with `wiki.publish: true`:
|
||||
- Pandoc-based markdown → wikitext rendering (h1 elements preserved)
|
||||
- Banner template injection
|
||||
- `Category:Tech blog` on every published page
|
||||
- `Category:Blog:<year>` from `date` field
|
||||
- `Category:Blog:<year>` from `date` field, falling back to the execution year
|
||||
- `Category:<tag>` per entry in `tags`
|
||||
- Idempotent writes
|
||||
- Manual-page protection
|
||||
|
||||
Reference in New Issue
Block a user