feat(feeds): publish a JSON Feed for the blog #11
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "json-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?
Stacked on #10 — base is
atom-feed, notmaster. Merge that one first.Adds JSON Feed 1.1 at
/blog/feed.json.Unlike #10 this isn't a correctness fix — Atom already resolved the RSS ambiguities. JSON Feed just makes the feed trivial to consume from a script, and the modern indie readers (NetNewsWire, Feedbin, Inoreader, Miniflux) support it. Everything else still has Atom and RSS.
config.yaml:application/feed+jsonmedia type + ajsonfeedoutput format.layouts/_default/list.jsonfeed.json: the template. Assembles a map and hands it tojsonifyso Go does the string escaping, and runs asisPlainText: trueso html/template doesn't mangle post content on its way into the JSON.baseof.html/index.html: autodiscovery tag and homepage link.summaryis plainified, since JSON Feed specifies it as plain text (Atom'ssummarycarries atypeattribute and can hold HTML).Verified:
hugobuilds all three feeds,jqparsesfeed.jsonwith 10 items andcontent_htmlintact, and the Atom feed still passesxmllint.