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 ScreenLayout editor, public reader, and the home_kind chooser.
  • 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) to RESERVED_SLUGS so a page slug can't be silently shadowed by the Axum layer.
  • PH2 — retry create_page with an incrementing slug suffix on a UNIQUE collision instead of surfacing a raw 500, mirroring the post-side helper.

Medium

  • PM1#[serde(skip)] on RenderedSection.body_html; the reader renders from body_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_image to server/admin/mod.rs.
  • PL4 — extract a snapshot_current callback in PageEditorForm.
  • PL5 — make LayoutSelector::status_msg Option<Signal<String>>; drop the dead layout_msg signal.
  • PL6 — add get_page_by_id_db + a shared assemble_page_detail to 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 — clean
  • cargo clippy -D warnings on server (sqlite + postgres) and wasm — clean
  • cargo test — 26 pass

🤖 Generated with Claude Code

Last updated 2026-06-02