How to use jq to extract new posts from a JSON Feed

I’m currently looking into ways to automate some stuff around new posts on this page (be it blog or TIL post) directly during the page build on GitHub Actions. For this, I first need to be able to reliably detect new posts, from a bash run step. So here’s how to do that with jq. The idea is to get the current feed.json prior to publishing the page, and then compare it to the one that was just generated during the build....

February 2, 2023 · 2 min

How to add JSON Feed support to Hugo

In order to add JSON Feed 1.1 support to Hugo you need to first add a new jsonfeed output format in config.yaml: mediaTypes: application/feed+json: suffixes: - json outputFormats: jsonfeed: mediaType: application/feed+json baseName: feed rel: alternate isPlainText: true This adds a new media type application/feed+json with the extension json and creates a new output format jsonfeed rendering into that media type with a base name of feed (so feed.json as recommended by the JSON Feed spec)....

January 29, 2023 · 3 min
Mastodon