Skip to content

fix(render): read a page's dates from the fields its workspace stamps - #13

Merged
adammharris merged 1 commit into
mainfrom
agent/backlog-follow-prov-vocabulary-shape-and-term-holds
Oct 21, 2026
Merged

adammharris merged 1 commit into
mainfrom
agent/backlog-follow-prov-vocabulary-shape-and-term-holds

Conversation

@adammharris

Copy link
Copy Markdown
Member

What changed

  • plates-render: a new public DateFields { created, updated } and a new field, SiteOptions::date_fields. A page's created/updated, and the date on its entry record, are read through it: the stamped field first, then the literal created/updated for that page. The default is None/None, which reads exactly as before.
  • plates-cli: build_sites fills date_fields from session.config.created_field() / updated_field().
  • docs/tasks/follow-prov-vocabulary-shape-and-term-holds.md is marked done.

Why

prov now has a workspace declare its stamped fields (fields.<name>.stamp: create / edit), but plates-render still looked for the literal names created and updated. So an archive that stamps modified published pages with no edit date in article:modified_time, feeds, the sitemap or template entries. This was step 7 of the task, and the last one left.

The literal names stay a per-page fallback, not just a per-workspace one. A page written before the workspace declared a stamp keeps its dates, and so does a page mounted from a peer that stamps the literal names. (A mounted peer that stamps some other name is still read with the host's names. Fixing that would mean carrying the fields per source, which this PR doesn't do.)

API note: SiteOptions gains a public field, so a caller that builds it with a struct literal and no ..SiteOptions::default() has to name the field. This is recorded in a Behavioural-change: trailer.

Closes

docs/tasks/follow-prov-vocabulary-shape-and-term-holds.md (step 7, the last one).

Verification

  • I wrote the tests first and saw them fail. In plates-render: a_page_reads_its_dates_from_the_fields_its_workspace_stamps and an_entry_record_is_dated_by_its_stamped_field. In plates-cli: a_page_shows_the_date_its_archive_stamps, an end-to-end build of an archive with fields.modified.stamp: edit, which failed with the wiring disabled. a_page_without_the_stamped_field_falls_back_to_the_literal_name pins the fallback.
  • ship ci ran all 7 jobs locally (fmt, clippy, test, docs, wasm, alone, msrv), and all passed.

plates-render read a page's creation and edit dates by the literal names
`created` and `updated`, while prov now has a workspace declare which fields
it stamps (`fields.<name>.stamp: create` / `edit`). An archive stamping
`modified` published its pages with no edit date.

`SiteOptions::date_fields` takes a `DateFields` naming the stamped fields,
and `plates-cli` fills it from the config's `created_field()` and
`updated_field()`. The literal names stay the fallback page by page, so a
workspace declaring no stamp reads as before. Closes the last step of
follow-prov-vocabulary-shape-and-term-holds.

Behavioural-change: a page in an archive whose config stamps a field other than `created` or `updated` now shows that field's date — in `article:published_time`/`article:modified_time`, feeds, the sitemap and a template's `entries` — where it showed none or the literal field's.
Behavioural-change: `plates_render::site::SiteOptions` has a new public field, `date_fields`; a caller building it with a struct literal and no `..SiteOptions::default()` must name it.
@adammharris
adammharris merged commit e032d8e into main Oct 21, 2026
8 checks passed
@adammharris
adammharris deleted the agent/backlog-follow-prov-vocabulary-shape-and-term-holds branch October 30, 2026 01:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant