feat(feeds): publish an Atom feed for the blog alongside RSS #10
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "atom-feed"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Adds an Atom feed at
/blog/atom.xml, prompted by Chris Morgan's Atom > RSS. Both of his substantive complaints applied to this site's feed: RSS 2.0 never specified whether<title>is plain text or HTML, and it has no way to distinguish a summary from full content.config.yaml: declare theapplication/atom+xmlmedia type and anatomoutput format (Hugo has no built-in one), and moveoutputsfrom the bogusblogkind tosection— Hugo only honours real page kinds, so that line was never doing anything.layouts/_default/list.atom.xml: the feed template. Titles usetype="text"; entries carry both<summary>and full<content>.baseof.html: feed autodiscovery<link rel="alternate">tags for both feeds.index.html: link the Atom feed next to the existing RSS link.RSS keeps being generated at
/blog/index.xml, so existing subscribers are unaffected; the feeds cross-link viarel="alternate".Verified:
hugobuilds clean andxmllint --noout public/blog/atom.xmlpasses, with all 10 posts present.