Skip to content

add garden posts to rss feeds

jedmund requested to merge jedmund/garden-rss into main

Created by: jedmund

Summary

  • Garden posts now show up in RSS. Published items with a note appear in a new /rss/garden feed; items also flagged showInUniverse promote into the main /rss "Everything" feed without creating a duplicate Post.
  • New Show in Universe toggle on the Garden composer (mirrors the Album pattern). Backed by a new GardenItem.showInUniverse column (default false) + migration, threaded through the admin create/update endpoints.
  • Extracted the duplicated RSS helpers (escapeXML, formatRFC822Date, extractTextSummary, convertContentToHTML) into src/lib/server/rss/helpers.ts so all three feed handlers share them.
  • Listed the new Garden feed on /feeds.

Only items with real commentary (non-null note) go into either feed — bare catalog entries stay out.

Test plan

  • Run npx prisma migrate dev to apply 20260422120000_garden_show_in_universe
  • In the admin, edit a published Garden item with a note, toggle Show in Universe on, save; edit another, leave it off
  • GET /rss/garden — both items present, note rendered as HTML, imageUrl as enclosure, link to /garden/{category}/{slug}, categories include creator/rating/favorite/current
  • GET /rss — only the opted-in item appears among Garden entries, interleaved with Posts/Albums by date
  • GET /feeds — Garden feed listed with working Subscribe link
  • Duplication check: promoted Garden item shows once (Garden entry), no shadow Post created
  • Confirm /rss and /rss/photos still byte-for-byte equivalent aside from the new Garden items (helper extraction is a mechanical move)
  • Validate new feed XML at https://validator.w3.org/feed/

Merge request reports

Loading