From 2e9c4f716d6ddadfb36f45b26a1383815359c1ae Mon Sep 17 00:00:00 2001 From: MatthewOwens Date: Sun, 19 Jul 2020 13:11:09 +0100 Subject: [PATCH] added rss generation scripts --- scripts/gen_feed.sh | 20 ++++++++++++++++++++ scripts/gen_feed_item.sh | 13 +++++++++++++ 2 files changed, 33 insertions(+) create mode 100755 scripts/gen_feed.sh create mode 100755 scripts/gen_feed_item.sh 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 "" -- 2.20.1