News system v1: dated news items with list module, paginated section list, news-list element, RSS #79

Closed
opened 2026-07-17 19:07:48 +02:00 by dominik.polakovics · 1 comment

What to build

A TYPO3-news-style news system for deckle, designed in a grilling session on 2026-07-17. News items are pages as records: ordinary pages of a new type news-item under a section of type news (the sysfolder equivalent), reusing the entire existing pipeline (elements, RTE, generated forms, publish/undo, detail URLs). No separate record engine.

Delivered as harness add news — a new generic harness add <feature> command that vendors an embedded feature bundle into an existing site: page-type + element sidecars, theme templates (list, detail, pager, RSS), and surgical hugo.toml edits (buildFuture = true). Machinery only: it does NOT create the news section; the developer/editor creates it via the page tree.

New generic engine primitives (none news-specific)

  1. datetime field type — 8th member of the closed field-type set; RFC3339 stored in front matter, mapped to Hugo's native date key for news items; date+time picker widget in the web UI. Triggers the internal/element/agentsdoc_test.go drift test → scaffold/site/AGENTS.md must be updated in the same change.
  2. childOrder page-type key (e.g. date-desc on the news type) — honored identically by theme templates and the editor page tree (internal/pagetree must decode dates); drag-to-reorder disabled where it applies, so editor order never lies about site order.
  3. hideChildPages page-type key — children of such a section stay out of the page tree; managed via the List module instead.
  4. defaults page-type key — creation-time front matter stamped on new pages of that type; the news type uses it for outputs: [html, rss], scoping RSS to the news branch while the scaffold's global no-feeds stance stays untouched.
  5. List module — a fifth, generic web module (web/src/modules.tsx): table of the selected tree item's direct child pages (title, type, date, draft/published status; edit/delete/create actions), sorted per childOrder. Selecting a hideChildPages section in the Page module still opens the section page normally, with a visible hint/affordance linking to the List module.

News content model

news-item fields beyond title + element body: datetime (publish date, drives ordering), teaser (textarea; used in lists/feed, falls back to truncated body), featured image (existing image field type / media library), author (plain text field).

Front-end (theme bundle)

  • News section list template: full date-sorted (newest first), paginated list via Hugo .Paginate (default page size ~10, configurable in hugo.toml); pager partial (first use of pagination in the theme).
  • news-list element — placeable successor to page-teasers with params section + limit, rendering "latest N news" on any page (e.g. homepage).
  • News detail via news-item single template: date, title, featured image, author, body elements.
  • RSS for the news section only (via the per-page outputs default above); RSS template added to the theme; internal/theme/theme_test.go:359 (asserts zero feeds) relaxed accordingly.
  • buildFuture = true: a future-dated item is visible immediately once published — what the editor sees is what is live (real scheduling deferred, see #78).

Explicitly out of scope for v1

  • Categories/tags → #77
  • Scheduled publishing (auto-appear at date) → #78
  • Year/month archive pages — the paginated list is the archive for now.

Acceptance criteria

  • harness add news vendors the news bundle into an existing site (never overwrites), edits hugo.toml (buildFuture = true), and the site builds with plain Hugo afterwards
  • datetime field type exists end-to-end (schema, canonicalization, generated form widget) and is documented in scaffold/site/AGENTS.md (drift test passes)
  • childOrder, hideChildPages, and defaults page-type keys implemented and documented in AGENTS.md
  • Creating a page of type news via the editor stamps outputs: [html, rss] from the page type's defaults
  • News items created via the List module appear date-sorted (newest first) in the List module, the section list page, and the news-list element; drag-reorder is disabled for date-ordered children
  • News items do not appear in the page tree (hideChildPages); the Page module shows an affordance to the List module for such sections
  • Section list page paginates; news-list element renders latest N on any page; detail page shows date, teaser/image/author, body
  • News section emits a valid RSS feed; no other feeds appear anywhere; theme tests updated
  • Future-dated items are visible immediately after publish (buildFuture = true)

Blocked by

None - can start immediately

## What to build A TYPO3-news-style news system for deckle, designed in a grilling session on 2026-07-17. News items are **pages as records**: ordinary pages of a new type `news-item` under a section of type `news` (the sysfolder equivalent), reusing the entire existing pipeline (elements, RTE, generated forms, publish/undo, detail URLs). No separate record engine. Delivered as `harness add news` — a new generic `harness add <feature>` command that vendors an embedded feature bundle into an existing site: page-type + element sidecars, theme templates (list, detail, pager, RSS), and surgical `hugo.toml` edits (`buildFuture = true`). Machinery only: it does NOT create the news section; the developer/editor creates it via the page tree. ### New generic engine primitives (none news-specific) 1. **`datetime` field type** — 8th member of the closed field-type set; RFC3339 stored in front matter, mapped to Hugo's native `date` key for news items; date+time picker widget in the web UI. Triggers the `internal/element/agentsdoc_test.go` drift test → `scaffold/site/AGENTS.md` must be updated in the same change. 2. **`childOrder` page-type key** (e.g. `date-desc` on the `news` type) — honored identically by theme templates and the editor page tree (`internal/pagetree` must decode dates); drag-to-reorder disabled where it applies, so editor order never lies about site order. 3. **`hideChildPages` page-type key** — children of such a section stay out of the page tree; managed via the List module instead. 4. **`defaults` page-type key** — creation-time front matter stamped on new pages of that type; the `news` type uses it for `outputs: [html, rss]`, scoping RSS to the news branch while the scaffold's global no-feeds stance stays untouched. 5. **List module** — a fifth, *generic* web module (`web/src/modules.tsx`): table of the selected tree item's direct child pages (title, type, date, draft/published status; edit/delete/create actions), sorted per `childOrder`. Selecting a `hideChildPages` section in the Page module still opens the section page normally, with a visible hint/affordance linking to the List module. ### News content model `news-item` fields beyond title + element body: `datetime` (publish date, drives ordering), `teaser` (textarea; used in lists/feed, falls back to truncated body), featured `image` (existing image field type / media library), `author` (plain text field). ### Front-end (theme bundle) - News section list template: full date-sorted (newest first), **paginated** list via Hugo `.Paginate` (default page size ~10, configurable in hugo.toml); pager partial (first use of pagination in the theme). - **`news-list` element** — placeable successor to `page-teasers` with params section + limit, rendering "latest N news" on any page (e.g. homepage). - News detail via `news-item` single template: date, title, featured image, author, body elements. - **RSS** for the news section only (via the per-page `outputs` default above); RSS template added to the theme; `internal/theme/theme_test.go:359` (asserts zero feeds) relaxed accordingly. - `buildFuture = true`: a future-dated item is visible immediately once published — what the editor sees is what is live (real scheduling deferred, see #78). ### Explicitly out of scope for v1 - Categories/tags → #77 - Scheduled publishing (auto-appear at date) → #78 - Year/month archive pages — the paginated list is the archive for now. ## Acceptance criteria - [ ] `harness add news` vendors the news bundle into an existing site (never overwrites), edits `hugo.toml` (`buildFuture = true`), and the site builds with plain Hugo afterwards - [ ] `datetime` field type exists end-to-end (schema, canonicalization, generated form widget) and is documented in `scaffold/site/AGENTS.md` (drift test passes) - [ ] `childOrder`, `hideChildPages`, and `defaults` page-type keys implemented and documented in AGENTS.md - [ ] Creating a page of type `news` via the editor stamps `outputs: [html, rss]` from the page type's `defaults` - [ ] News items created via the List module appear date-sorted (newest first) in the List module, the section list page, and the `news-list` element; drag-reorder is disabled for date-ordered children - [ ] News items do not appear in the page tree (`hideChildPages`); the Page module shows an affordance to the List module for such sections - [ ] Section list page paginates; `news-list` element renders latest N on any page; detail page shows date, teaser/image/author, body - [ ] News section emits a valid RSS feed; no other feeds appear anywhere; theme tests updated - [ ] Future-dated items are visible immediately after publish (`buildFuture = true`) ## Blocked by None - can start immediately
Author
Owner

Implementation note (from triage): this issue is intentionally one end-to-end slice spanning five surfaces. To keep the resulting PR reviewable, implement it as a sequence of self-contained commits in dependency order, one surface per commit:

  1. datetime field type end-to-end (Go schema, canonicalization, form widget, drift test, AGENTS.md)
  2. Page-type keys childOrder, hideChildPages, defaults + date-aware sorting in internal/pagetree (AGENTS.md)
  3. Generic List module in the web UI (table of direct children, create/edit/delete, hint affordance from Page module)
  4. Theme bundle: news list/detail templates, pager partial, news-list element, RSS template + theme test updates
  5. harness add <feature> command vendoring the news bundle, incl. surgical hugo.toml edit (buildFuture = true)

Each commit should build and pass tests on its own. Judgment calls to make conservatively (they are the two spots not fully pinned by the spec): the List module's create flow UX, and how harness add edits hugo.toml. Verify the editor surfaces end-to-end with the playwright-core + nix chromium recipe against harness serve, not only unit tests.

Implementation note (from triage): this issue is intentionally one end-to-end slice spanning five surfaces. To keep the resulting PR reviewable, implement it as a sequence of self-contained commits in dependency order, one surface per commit: 1. `datetime` field type end-to-end (Go schema, canonicalization, form widget, drift test, AGENTS.md) 2. Page-type keys `childOrder`, `hideChildPages`, `defaults` + date-aware sorting in `internal/pagetree` (AGENTS.md) 3. Generic List module in the web UI (table of direct children, create/edit/delete, hint affordance from Page module) 4. Theme bundle: news list/detail templates, pager partial, `news-list` element, RSS template + theme test updates 5. `harness add <feature>` command vendoring the news bundle, incl. surgical `hugo.toml` edit (`buildFuture = true`) Each commit should build and pass tests on its own. Judgment calls to make conservatively (they are the two spots not fully pinned by the spec): the List module's create flow UX, and how `harness add` edits `hugo.toml`. Verify the editor surfaces end-to-end with the playwright-core + nix chromium recipe against `harness serve`, not only unit tests.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Cloonar/deckle#79
No description provided.