From 861b955552d42b048d1ba17d4a48c953aeefe272 Mon Sep 17 00:00:00 2001 From: lonkaars Date: Fri, 16 Jul 2021 16:56:43 +0200 Subject: add rss feed --- rss/base.xml | 10 ++++++++++ rss/genrss | 27 +++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 rss/base.xml create mode 100755 rss/genrss (limited to 'rss') diff --git a/rss/base.xml b/rss/base.xml new file mode 100644 index 0000000..daa65ad --- /dev/null +++ b/rss/base.xml @@ -0,0 +1,10 @@ + + + + Loek's excruciatingly interesting blog + This is where I post updates on things that I do + en-us + https://blog.pipeframe.xyz/atom.xml + + + diff --git a/rss/genrss b/rss/genrss new file mode 100755 index 0000000..7cfd005 --- /dev/null +++ b/rss/genrss @@ -0,0 +1,27 @@ +#!/bin/sh + +cd $(dirname $0) + +# exit if no out dir +[[ ! -d ../out ]] && exit 1 + +cp base.xml atom.xml +for file in ../out/post/*; do + base=$(basename "$file" .html) + + xml ed -L \ + -s '/rss/channel' -t elem -n item \ + --var newitem '$prev' \ + -s '$newitem' -t elem -n title -v "$(../scripts/meta title "../posts/${base}.md" | jq --raw-output)" \ + -s '$newitem' -t elem -n guid -v "$base" \ + -s '$newitem' -t elem -n link -v "/post/$base" \ + -s '$newitem' -t elem -n pubDate -v "$(../scripts/meta date "../posts/${base}.md" | jq --raw-output)" \ + -s '$newitem' -t elem -n description -v "$(pup -f "../out/post/${base}.html" .contentWrapper)" \ + atom.xml +done + +mv atom.xml ../public + +cd .. +npx next build +npx next export -- cgit v1.2.3