aboutsummaryrefslogtreecommitdiff
path: root/scripts/generate_rss.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/generate_rss.sh')
-rwxr-xr-xscripts/generate_rss.sh19
1 files changed, 19 insertions, 0 deletions
diff --git a/scripts/generate_rss.sh b/scripts/generate_rss.sh
new file mode 100755
index 0000000..17b0395
--- /dev/null
+++ b/scripts/generate_rss.sh
@@ -0,0 +1,19 @@
+#!/usr/bin/env bash
+# Generate index.html page
+
+INPUT_FILES=${@}
+PROJ_ROOT=$(git rev-parse --show-toplevel)
+source ${PROJ_ROOT}/scripts/site-templates.sh
+
+echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>"
+echo "<rss version=\"2.0\" xmlns:atom=\"http://www.w3.org/2005/Atom\">"
+echo "<channel>"
+echo "<title>~kballou/blog</title>"
+echo "<link>https://kennyballou.com</link>"
+echo "<language>en-us</language>"
+echo "<author>Kenny Ballou</author>"
+echo "<copyright>Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License</copyright>"
+echo "<updated>$(date --utc --rfc-3339='date')</updated>"
+cat ${INPUT_FILES} | sort -r -n -k1 -k2 -k3 | awk -F' ' '{print $4}'
+echo "</channel>"
+echo "</rss>"