Skip to main content

Module feed

Module feed 

Source
Expand description

RSS 2.0, Atom 1.0 and JSON Feed 1.1 for a site’s one content stream.

A site gets exactly one feed, served in all three formats. Which entries it holds is passed in rather than derived: a blog is a dynamic_page_group, and a dynamic page builds its template data per request, so there is nothing to harvest at boot.

Three properties are load-bearing and easy to break:

  • The documents are byte-stable. <lastBuildDate> and <updated> come from the newest entry, never from the clock, and ties break on path. A timestamp or a map iteration order in the body would change the bytes on every deploy, and every subscriber would re-download a feed that did not change.
  • Content is rewritten, not copied. See [rewrite].
  • Text is escaped by the writer. quick_xml::events::BytesText::new escapes; nothing here hand-rolls it. What escaping cannot fix — characters outside XML’s Char production — is stripped in [sanitize].

Structs§

Feed
A site’s one feed.
FeedDocument
One rendered feed document.
FeedEntry
One item in a feed.
FeedSet
All three documents, plus what they share.
FeedSite
Channel-level metadata, all of it derived from what the site already declares rather than configured a second time.

Enums§

FeedError
Why a feed could not be produced.

Constants§

ATOM_PATH
Where the Atom 1.0 document is served.
FEED_MAX_AGE_SECONDS
How long a feed may be served from a cache before revalidating.
JSON_PATH
Where the JSON Feed 1.1 document is served.
MAX_FEED_ENTRIES
How many entries a feed carries, newest first.
RSS_PATH
Where the RSS 2.0 document is served.

Functions§

build_feeds
Builds all three feed documents.