feat(categories): categories bundle managed in the editor as Hugo term pages #160
No reviewers
Labels
No labels
bug
enhancement
needs-triage
ready-for-agent
ready-for-human
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Cloonar/deckle!160
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "afk/152"
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?
Closes #152
What
Categories become a site-wide feature, managed in the editor. A category is a Hugo term page,
content/categories/<slug>/_index.md. Pages store its slug, and its title is the name shown everywhere.Categories bundle (
harness add categories)/categories/page (hidden: true; Hugo also leaves taxonomy pages out ofsite.Home.Pages);categoriesandcategorypage types;taxonomy.htmlandterm.html;hugo.tomledits: thedisableKinds,taxonomiesandoutputssteps moved here from news. The step IDs are unchanged.term.htmldraws each page with.Render "category-entry". Hugo resolveslayouts/news-item/category-entry.htmlfor news items, so they show as news cards; other pages fall back to the bundle's default (title link plus summary).harness remove categoriessucceeds without--purgeright after an add. The removecmd scan no longer counts an intact page the bundle shipped as content in use. Categories created beneath it still count, and--purgedeletes them.categoriesfield typefields:and elementparams:.categories, and a field namedcategoriesmust have this type. It takes nooptions:ordefault:. Each violation is a load error that names the file.GET /api/categories.CategoriesFieldwidget shows titles and stores slugs;Rename and delete
categoriesparams on any shortcode at any depth.{deleted, changed}.GET /api/page/delete-planreturns the same counts, and the confirmation dialog states how many pages will change./categories/slug is pinned on rename;News (version 4)
news-itemand "Latest news" use the new type. "Latest news" shows items in any of the chosen categories, applies the limit after filtering, and shows all news when none are chosen./categories/templates.news-card.htmlpartial draws every news card.Docs
scaffold/site/AGENTS.mdand the README cover:Verification
go vet ./...andgo test ./...pass with Hugo 0.163.3 on PATH. The theme, add and remove Hugo build tests ran, including the categories-only site, the term page for a category with no pages, drafts excluded, and/categories/not in the nav.cd web && npm run build && npm testpasses (1853 tests), andtsc --noEmitis clean.harness serveon a fresh site with categories and news, through the HTTP API and a Hugo build:🤖 Generated with Claude Code
Categories become a site-wide feature instead of a news detail. A category is a Hugo term page, content/categories/<slug>/_index.md: pages store its slug, its title is the name shown in the editor and on the site. - New `categories` feature bundle: the /categories/ page (kept out of the nav), the categories and category page types, the Categories module (Properties-only entries, sorted by title), the /categories/ and /categories/<slug>/ templates (pages drawn through a `category-entry` content view), and the taxonomy hugo.toml edits moved over from news. `harness remove categories` succeeds without --purge right after an add: an intact shipped page is not content in use. - New `categories` field type for page-type fields and element params, bound to the name `categories` both ways, no options/default. Front matter stores a list, shortcode params comma-joined slugs. Saves reject unknown slugs; stale slugs are hidden and dropped at the next save. GET /api/categories lists the site's categories. - Rename rewrites the slug in every page's front matter and every element's categories param alongside the alias and link rewrites; delete removes it everywhere (emptied key/param removed) and the confirmation states how many pages change (GET /api/page/delete-plan). The /categories/ slug is pinned, categories cannot be moved, have no Enable/Disable, and are created live rather than as drafts. - Editor modules accept the type in columns, card tags and filters, showing category titles and filtering by slug. - News (v4): news-item and "Latest news" use the new type ("Latest news" shows items in any chosen category, limit after filtering, none = all); no hand-kept option lists, taxonomy edits or /categories/ templates. News cards come from one shared news-card partial. - AGENTS.md and README document the field type, the bundle, the opt-in, rename/delete and the news changes. Closes #152 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>[autoland] verdict: pass
Verdict: CONCERNS (non-blocking), approved; awaiting the maintainer's go-ahead to merge.
Signal: CI
ci / build-and-testis green (go vet, go test with Hugo 0.163.3, web build and vitest). It was not re-run. The head already containsmain, and there is no conflict.Checked:
/categories/slug stays pinned, categories can't be moved, and new categories are created live, not as drafts.taxonomy.html,term.html,category-entryand the news-list filter.harness remove categoriessucceeds without--purgeright after an add.Concerns (non-blocking, worth follow-up issues):
harness remove categories --purgedoesn't report the pages it rewrites.internal/removecmd/purge.go:224discardsDeleteResult.Changed.usageandPurgeReportlist only the category pages.run.go:35: "the full preview of what a purge would do").A slow category list can still commit after Cancel. When a dialog has a
categoriesfield, submit now waits forGET /api/categories, with no guard while it waits.web/src/rte/RichTextField.tsx:658(chip dialog): Cancel or Escape during the load still inserts the chip, and a double-click inserts two.web/src/components/CreateDialog.tsx:141: Cancel during the load still creates the page.Minor (below the bar, noted only):
categories: \"a, b\"is split into two slugs by the editor (categoryrewrite.go:244,modules.go:378), but Hugo reads it as one term.modules.go:383).hugo.tomlone blank line short of a fresh init.[autoland] verdict: pass
Re-validation of
ce5b511. Verdict: PASS (approved); awaiting the maintainer's go-ahead to merge.Signal: CI
ci / build-and-testis green once5b511(run 145). It was not re-run. The head still containsmain, and there is no conflict.Both concerns from the previous review are resolved:
pageops.DeleteResultgainsChangedPages(the HTTP API still sends only the counts).pageops.DeletePlanper root, and the purge result reports what the delete actually rewrote. Pages inside the purge set are left out.categoriesRemovedFromin--json.pageops.Deletecomputes its category rewrites from the stripped bytes. In the old order, a strip could write a removed slug back.TestPurgeStripsBeforeDeletingCategories,TestRunCategoriesRemovedFromandTestRemoveCmdCategoriesRemovedFrom.CreateDialogandChipDialogset aclosedflag on cleanup and commit nothing after the category list loads if it is set.ChipDialogalso holds its button while it waits, so a double-click inserts one chip.Minor (below the bar, unchanged from before):
categories: \"a, b\"is split into two slugs by the editor, but Hugo reads it as one term.hugo.tomlone blank line short of a fresh init.