feat: datetime round-trip in page properties, shared news cards, shownFields per page type #159
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!159
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "afk/151"
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 #151
Fixes the date round-trip reported in #133 (closed as a duplicate of #151).
Dates (#133)
fieldValue(internal/pageops/settings.go) readsdatetimefields throughcontent.DateRFC3339, the conversion the page tree and module entries already use. Every spelling in the issue's table now reaches the form as RFC3339. An untouched save stores a quoted RFC3339 string holding the same instant. An unreadable value falls back to the field's default, else empty.TestReadSettingsDatetimeSpellings(7 spellings: read, save, and a check that the stored instant is unchanged) andTestReadSettingsDatetimeUnreadable. All of them failed before the fix.News cards
partials/news-teasers.htmlnow draws only the card list. Each caller draws its own wrapper:news/list.html,term.html, and thenews-listshortcode, whose root still carriesid="c-<uid>"and thedata-ce-*markers and renders with no items or a stale section. "Latest news" now shows the same cards as the archive, image and categories included.allNewsLinkbool param (Show "All news" link, defaultfalse). It adds an "All news →" link to the section URL, and only when the section resolves.version: 3; the tests that pinned the version are updated.hugo server.shownFieldstitleis always accepted and always shows.backendLayoutNextLevelon a type withchildren: [], sonews-itemshows only "Backend layout".[]shows only the title. A list shows the title plus exactly the listed fields, and the form keeps its usual order.settingsFieldsonly. Hidden fields keep their stored front matter (including a link field'sTargetcompanion) through a save./api/pagetypesfields, the create dialog,Createseeding and module columns, sorts and filters are not filtered; tests cover each of these.Type label
PageSettingsshows the type's label ("Type: News item") throughpageTypeLabel, in the page module and on the module's Properties tab. A type without a sidecar shows its id.Docs
scaffold/site/AGENTS.md:shownFields, how front-matter dates are written and read (datetimeparagraph and "Editing content by hand"), the shared news cards andallNewsLink.README.md:shownFieldsand the bundle version 3 examples.internal/pagetypepackage doc:shownFields.Verification
npm run build,tsc --noEmitandnpm testpass: 65 files, 1821 tests.go vet ./...andgo test ./...pass, with Hugo extended 0.163.3 on PATH; the news theme tests ran, none skipped.go build ./cmd/harnesssucceeds.harness serve.🤖 Generated with Claude Code
[autoland] verdict: pass
PASS. Validated against #151 (and #133, which it fixes).
Signal relied on: Forgejo Actions
ci / build-and-testis green (run 142). It covers the frontend build and tests,go vet, andgo test ./...with Hugo extended 0.163.3 installed, so the news theme tests ran. Nothing was re-run locally. The head already containsmain, so there is no conflict.Checked:
Closes #151and links #133.fieldValuenow sendsdatetimethroughcontent.DateRFC3339. An unreadable value falls back to the default, else empty. Seven spellings are tested end to end: read, untouched save, and the same instant on disk.shownFields:settingsFieldsfilters a freshly built slice, soschema.Fieldsis never aliased.SaveSettingsvalidates and applies only the filtered fields, so hidden keys and linkTargetcompanions are untouched. Load errors cover unknown names, repeated names and required fields left out./api/pagetypesfields, the create dialog and module columns, sorts and filters are not filtered, and each has a test.ce/attrs.html.allNewsLinkuses the section page's.RelPermalinkand renders only when the section resolves. Bundle version is 3.PageSettingsusespageTypeLabeland falls back to the type id.shownFields, how front-matter dates are written, the shared cards andallNewsLink, per CLAUDE.md.Note (not blocking): the PR body says the manual browser check against
harness servefrom the issue's How-to-verify was not done. Unit, server, component and theme tests cover the behaviour.