WordPress-style pages with home chooser
WordPress-style pages with home chooser
#27 in Riparion/riparion-cms — merged 2026-06-01
Adds WordPress-style hierarchical pages with a multi-region layout editor, plus a home chooser so / can render either the chronological feed or a static page (with /blog always serving the feed).
Commits
- Add WordPress-style pages with home chooser — pages model, materialized-path tree, multi-region
ScreenLayouteditor, public reader, and thehome_kindchooser. - Move home-page source toggle from Appearance to Settings — relocates the feed-vs-page toggle to its more natural home.
- Fix pages/home-chooser bugs from review (PH1–PL6) — the review-driven fixes below.
Review fixes (PH1–PL6)
High
- PH1 — add the bare Axum route segments (
rss,feed,atom,sitemap,uploads,site) toRESERVED_SLUGSso a page slug can't be silently shadowed by the Axum layer. - PH2 — retry
create_pagewith an incrementing slug suffix on a UNIQUE collision instead of surfacing a raw 500, mirroring the post-side helper.
Medium
- PM1 —
#[serde(skip)]onRenderedSection.body_html; the reader renders frombody_segments, so the pre-rendered HTML no longer crosses the wire. - PM2 — show an editor-only banner when the configured home page is a draft, explaining the public sees the feed at
/until it's published.
Low
- PL1 — correct the DFS comment and add a visited-set cycle guard in
update_page_db. - PL2 — extract
mdx::render_segments, shared by the editor preview and the reader. - PL3 — hoist
validate_status/validate_featured_imagetoserver/admin/mod.rs. - PL4 — extract a
snapshot_currentcallback inPageEditorForm. - PL5 — make
LayoutSelector::status_msgOption<Signal<String>>; drop the deadlayout_msgsignal. - PL6 — add
get_page_by_id_db+ a sharedassemble_page_detailto drop the id→path round trip on the home-page hot path.
Notes
- PH2's slug retry is scoped to create (matching posts); on update a duplicate slug still returns a generic error rather than silently renaming a slug the user typed.
- PM2's banner is in addition to
PageView's existing generic "Draft preview" alert — it adds the home-chooser-specific context.
Verification
cargo fmt --check— cleancargo clippy -D warningson server (sqlite + postgres) and wasm — cleancargo test— 26 pass
🤖 Generated with Claude Code
Last updated 2026-06-02
Links to this note
Credits
Merged pull requests, newest first.