Skip to main content

Module feed

Module feed 

Source
Expand description

Per-page-type RSS 2.0 + Atom 1.0 feeds — “syndication on demand”, powered by rustango::syndication.

§Opt-in

A crate::PageTypeHandler joins the feed surface by overriding crate::PageTypeHandler::feed_kind to return Some("slug"). The slug is the URL path segment under /feed/<slug>/...:

ⓘ
impl PageTypeHandler for ArticlePage {
    // …
    fn feed_kind(&self) -> Option<&'static str> { Some("articles") }
}

Then /feed/articles/rss.xml and /feed/articles/atom.xml enumerate every published, indexable crate::Page whose page_type_id resolves to that handler, newest first.

§Content mapping

Feed fieldCMS source
<title>page.title
<link> / <id>https?://<host><page.url_path> (Host-derived; see crate::sitemap for the scheme/host logic)
<description>page.seo_description (falls back to empty)
<pubDate> / <updated>page.published_at (falls back to updated_at)

Excludes pages with robots_index = false (mirroring the sitemap exclusion) and locale variants (canonical row only).

§Feed metadata

<channel>-level title is derived from tenant.org.display_name; description is a generic “Latest <handler verbose_name>” line. Neither is overridable per tenant: the feed does not read SiteSetting rows.

Constants§

FEED_MAX_ITEMS
Most items a feed carries. Readers poll feeds on a timer, so an uncapped feed made every poll load and serialise the type’s whole history; syndication convention is the latest 10-50.

Functions§

handle_feed_atom
GET /feed/{kind}/atom.xml
handle_feed_rss
GET /feed/{kind}/rss.xml