From 44b4319318b33b3f52b77cc54e27ace804dd7677 Mon Sep 17 00:00:00 2001 From: lucidiot Date: Tue, 23 Mar 2021 23:37:00 +0100 Subject: [PATCH] Add an RSS feed, close #2 --- build.sh | 59 ++++++++++++++++++++++++++++++++++++--------- content/feeds.md | 2 +- include-header.html | 1 + 3 files changed, 50 insertions(+), 12 deletions(-) diff --git a/build.sh b/build.sh index 4425196..a3cc091 100755 --- a/build.sh +++ b/build.sh @@ -32,16 +32,6 @@ for file in content/**/*.md; do convert "$file" "$output" done -# Build the 'everything' page -echo "--- -title: everything ---- -" > "$tree_file" -pushd html >/dev/null -tree --du --si -X --prune -P '*.html' | xsltproc ../xsl/tree.xsl - >> "$tree_file" -popd >/dev/null -convert "$tree_file" "html/everything.html" - function link_assets { for src in "$1"/*; do dest="${src/#assets/html}" @@ -53,5 +43,52 @@ function link_assets { fi done } - link_assets assets + +# Build the 'everything' page +echo "--- +title: everything +--- +" > "$tree_file" +pushd html >/dev/null +tree --du --si -X --prune -P '*.html' | xsltproc ../xsl/tree.xsl - >> "$tree_file" +popd >/dev/null +convert "$tree_file" "html/everything.html" + +# Build an RSS feed +echo ' + + + ~lucidiot'"'"'s wiki + https://envs.net/~lucidiot/ + latest articles on ~lucidiot'"'"'s personal wiki + en-FR + Creative Commons BY 4.0 International, ~lucidiot + lucidiot@envs.net (lucidiot) + lucidiot@envs.net (lucidiot) + /bin/bash + https://www.rssboard.org/rss-specification + + + +' > html/rss.xml + +for file in content/**/*.md; do + link="${file/#content/html}" + link="https://envs.net/~lucidiot/${link/%.md/.html}" + echo ' + '"$(sed -n 's|\s*title:\(.*\)$|\1|p' "$file")"' + '"$(date -Rd "@$(stat -c%Y "$file")")"' + '"$link"' + '"$link"' +' >> html/rss.xml +done +echo ' +' >> html/rss.xml +chmod 644 html/rss.xml diff --git a/content/feeds.md b/content/feeds.md index 3797216..c9479fe 100644 --- a/content/feeds.md +++ b/content/feeds.md @@ -8,6 +8,7 @@ title: feeds * [a quest to identify plants](//tilde.town/~lucidiot/plants/feed.xml) * [#fridaypostcard](//tilde.town/~lucidiot/fridaypostcard.xml) * [rsrsss](./rsrsss/) +* [this wiki](./rss.xml) ## twtxt @@ -21,6 +22,5 @@ title: feeds ## planned feeds -* updates on this wiki * my breadsite * rocket launches, with georss and/or eventrss support diff --git a/include-header.html b/include-header.html index a34c69a..22cc7fd 100644 --- a/include-header.html +++ b/include-header.html @@ -1 +1,2 @@ +