PhoenixKit.Modules.Publishing.Web.Controller.Feed (PhoenixKitPublishing v0.4.5)

Copy Markdown View Source

RSS 2.0 feed rendering for a publishing group.

Served at /<group>/feed.xml (and the localized /:language/<group>/feed.xml) by the public controller's {:feed, group_slug} branch — "feed.xml" is a reserved tail segment in Routing.parse_path/1, so it can never collide with a post slug. Items come from Listing.chronological_posts/3 (published, language-filtered, newest-first — independent of the group's listing_sort).

The XML is hand-built iodata: RSS 2.0 is a small fixed vocabulary, and a dependency-free builder keeps the module's "no new deps" posture. All dynamic content is escaped (or CDATA-wrapped with ]]> split, which is the one sequence CDATA cannot contain).

Element order and shapes follow the RSS 2.0 spec plus the Atom self link convention (atom:link rel="self"), which feed validators expect.

Summary

Functions

Renders the RSS 2.0 document for a group as iodata.

Functions

render_rss(group, posts, opts)

Renders the RSS 2.0 document for a group as iodata.

  • group — the public group map (Publishing.get_group/1 shape).
  • posts — chronological post maps (Listing.chronological_posts/3).
  • opts:base_url (scheme://host[:port], no trailing slash — required), :language (resolved request language — required), :date_counts (date → count map over the group's WHOLE published set — pass it when posts is a truncated window, else a same-day sibling outside the window would make a timestamp item link a date-only URL that resolves to the wrong post).