From: MatthewOwens Date: Sun, 19 Jul 2020 12:11:09 +0000 (+0100) Subject: added rss generation scripts X-Git-Url: https://git.owens.tech///git?a=commitdiff_plain;h=2e9c4f716d6ddadfb36f45b26a1383815359c1ae;p=website.git added rss generation scripts --- diff --git a/scripts/gen_feed.sh b/scripts/gen_feed.sh new file mode 100755 index 0000000..5ca1292 --- /dev/null +++ b/scripts/gen_feed.sh @@ -0,0 +1,20 @@ +#!/bin/sh +printf '\n' +printf '\n' +printf '\n' +printf '\n' + +printf '\tMatthew Owens\n' +printf '\tUpdates from Matthew Owens\n' +printf '\ten-gb\n' +printf '\thttps://owens.tech/rss.xml\n' +printf '\t\n' + +# generate + +printf '\n\n' +find posts/ -type f -exec sh -c "scripts/gen_feed_item.sh {}" \; +printf '\n\n' + +printf '\n' +printf '\n' diff --git a/scripts/gen_feed_item.sh b/scripts/gen_feed_item.sh new file mode 100755 index 0000000..7892595 --- /dev/null +++ b/scripts/gen_feed_item.sh @@ -0,0 +1,13 @@ +# ensuring that at least that the post md file is passed in +[ $# -eq 1 ] || exit 1 + +HTMLPATH=$(echo $1 | sed 's/\.md$/.html/') +TITLE=$(scripts/post_title.sh $1) +BODY=$(markdown $1 | sed -e 's/’/'/g -e 's/‘//g') + +echo "" +echo " $TITLE" +echo " https://owens.tech/posts/$HTMLPATH" +echo " TODO" +echo " $BODY" +echo ""