feat(news): enable categories taxonomy and term pages in the news bundle #132
No reviewers
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Cloonar/deckle!132
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "afk/129"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
harness add newsnow configures the site for a singlecategoriestaxonomy and the news bundle renders working term pages. Closes #129.What changed
Config step — a new
ensureCategoriesTaxonomystep runs afterensureBuildFutureand editshugo.tomlwith the same line-based, surgical approach:taxonomy/termfromdisableKinds; when the array empties, the entry and its attached# No taxonomies in the starter site…comment are deleted whole (the comment is only true while the kinds are disabled);[taxonomies] category = 'categories'— presence wins: an existing[taxonomies]table is never merged into, mirroring buildFuture's idempotence style;taxonomy = ['html']/term = ['html']to[outputs], extending the site's existing "restrict output to HTML" policy — without this Hugo would emit its embedded RSS feed for/categories/and every term, and term RSS is explicitly out of scope.Re-running the step on its own output is a byte-identical no-op, and it refuses (errors) on any config the scanner cannot confidently model. A site that never adds the news feature keeps taxonomy kinds disabled —
scaffold/site/hugo.tomlis untouched.Templates — the bundle vendors
term.html(a category's news items, non-draft, date-descending, paginated exactly like the section list via the shared pager partial) andtaxonomy.html(the/categories/overview: terms in use with non-draft item counts, draft-only terms skipped). They sit at the layouts root, not_default/: since Hugo 0.146 a_default/taxonomy.htmlis a lookup candidate for both the taxonomy and term kinds and shadows_default/term.html(verified against the real binary). The item-card markup is extracted into a sharedpartials/news-teasers.htmlused by both the section list and term pages so the two can never drift.Docs/UX — post-add next steps now explain the front-matter
categoriesopt-in (the editor field ships in a separate stacked issue), andscaffold/site/AGENTS.mddocuments the bundle's extended config edits per the CLAUDE.md drift rule.Verification
go test ./...,go vet ./...,go build ./...,gofmt— all clean (real-Hugo integration tests included).[taxonomies]untouched, extradisableKindsvalues kept with their comment, pre-restricted outputs untouched), table-driven transform unit tests (every output re-parsed with Hugo's TOML decoder), and an end-to-end init→add→hugo build asserting/categories/+ term page render with noindex.xmlunder them.productand three undercompany, plus one draft item carryingproductand a draft-onlysecretterm. Subtests pin overview hrefs/titles/counts in.ByTitleorder, term-page pagination (10 newest + pager + page/2 overflow), single-page term without pager, and the one-feed sweep. A second--buildDraftsbuild proves the templates' explicit draft filters: term lists and counts unchanged, the generated/categories/secret/page lists nothing, and the overview omits it — a plain build cannot exercise those filters because Hugo drops drafts on its own.🤖 Generated with Claude Code
Landing validation — PASS
Verification signal relied on: Forgejo Actions CI,
ci / build-and-test (pull_request)— success (6m8s, run 121). Not re-run. This repo's CI is unconditional and installs the pinned Hugo 0.163.3 beforego vet ./... && go test ./... && go build, so the real-Hugo theme integration tests covering this PR's acceptance criteria genuinely executed. No conditional gate skipped the path this diff touches.Checks performed
main, no conflicts.feat(news): …is Conventional Commits. Body carries a workingCloses #129, so the merge will auto-close the issue and release theafk/129claim.scaffold/site/AGENTS.mddocuments the news bundle's extendedhugo.tomledits (taxonomy declaration, re-enabled kinds, HTML-restricted outputs).scaffold/site/hugo.tomlis untouched, so a site that never adds news keepsdisableKinds = ['taxonomy', 'term']. The root-leveltaxonomy.html/term.htmlplacement is correct and justified in-comment — since Hugo 0.146 a_default/taxonomy.htmlshadows_default/term.html. Idempotence holds by inspection: on a second run all three transforms hit their unchanged paths and the file is byte-identical with no write.hugo buildasserting/categories/and term pages render with noindex.xml. A second--buildDraftsbuild proves the templates' explicit draft filters, which a plain build cannot exercise.Non-blocking observations
ensureTaxonomiesTablematches ataxonomiestable without checkingisArray, so a[[taxonomies]]array-of-tables would also count as "already configured" — whereasensureTaxonomyHTMLOutputsdoes check!isArrayfor[outputs]. The asymmetry is harmless: it fails toward leaving the config untouched, which is the safe direction for a presence-wins step.taxonomy.html/term.htmlare generic root templates and would render any future taxonomy, not justcategories. Intentional and documented in the template comments; worth revisiting only if a second taxonomy is ever added.Verdict: PASS — no blockers. Awaiting the maintainer's merge confirmation.