feat: page-teasers section becomes a picked page reference #98
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!98
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "afk/89"
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?
Upgrades the scaffolded
page-teaserselement'ssectionparam fromtype: texttotype: page, so editors pick the section from the shared page-tree picker (the news-list pattern from #86) and the stored value is the page's canonical pretty URL. Per the issue, nopageType:restriction — any section-like page may be teased.What changed
scaffold/editor/elements/page-teasers.yaml—sectionis nowtype: page,required: true, label "Section" (was "Section path"); header comment rewritten in news-list's style.internal/pageops/pagerefs.go— text-era content stores hand-typed paths like/posts, but canonical permalinks carry a trailing slash (/posts/) andCheckPageParamsmatched exactly, so the flip alone would 422 every untouched legacy value on re-save. The validator now tolerates exactly one deviation: a value missing only the trailing slash is retried with it appended, then flows through the existing pageType check unchanged. Dangling paths, wrong-type pages, and any other legacy shape (e.g.postswithout the leading slash) are still rejected.FindByPermalinkitself stays exact — its other callers rely on that.scaffold/themes/deckle/layouts/shortcodes/page-teasers.html— comment-only update; every line of template logic is untouched, so shortcode output is byte-identical for the same stored value (Hugo'ssite.GetPagealready resolves both forms).scaffold/site/AGENTS.md— thepagefield-type paragraph documents the trailing-slash grace (blueprint-tracks-engine rule; agentsdoc drift test green).pagerefs_test.go: legacy form passes, dangling fails in both forms, grace is exactly the trailing slash, pageType enforced on tolerated values.theme_test.go+ new fixturetestdata/library-site/content/teasers-canonical/: the home page (legacysection="/posts") renders exactly the non-draft posts, and a page storing canonicalsection="/posts/"renders a byte-equal teaser list.Acceptance criteria → proof
type: page, required, label in spirit → yaml difffields.tsxdispatches onparam.type === "page"since #86), no web change needed/postsloads, validates, publishes unchanged → validator grace + untouched shortcode; library-site fixture keeps the legacy form and its build output is assertedCheckPageParamspasses valid sections, rejects dangling → new unit testsVerification
go vet ./...clean;go test -count=1 ./...— 21 packages ok (hugo in PATH, no skips;TestPageTeasersSectionFormsran); webvitest792/792.Noted, not changed:
internal/server/linktargets.goresolveslinkvalues with the exact matcher — correct to leave, since link values were always picker-written canonical URLs.Closes #89
🤖 Generated with Claude Code
Landing audit — #98
feat: page-teasers section becomes a picked page referenceVerdict: PASS.
ci / build-and-test— success (run #79, 5m53s). Not re-run.feat:✓afk/89, body carries a validCloses #89✓merge-treeagainstmainreports no conflict (branch is behind main but merges cleanly).page-teasers.yaml:sectionflippedtext→page,requiredkept, label "Section path"→"Section" ✓pagerefs.go: trailing-slash grace is narrowly scoped — retried only on exact-match miss, single/append, still enforces the pageType check;FindByPermalinkstays exact for other callers ✓.html: comment-only, template logic byte-identical ✓AGENTS.md: documents the grace (blueprint-tracks-engine rule; agentsdoc drift test green in CI) ✓/postsaccepted, dangling rejected both forms, grace limited to trailing slash, pageType enforced, byte-equal fixture render.All five acceptance criteria addressed. Awaiting free-text merge go-ahead.