summaryrefslogtreecommitdiff
path: root/update.sh
diff options
context:
space:
mode:
authorpux <pux@raumdock.pux.dom>2023-01-07 13:28:46 +0100
committerpux <pux@raumdock.pux.dom>2023-01-07 13:28:46 +0100
commit6d0354fccb7f3043446078521333c2724c2f8d0c (patch)
treee948be553fa17e8e0d07b983575389c44525afc7 /update.sh
parent4110d0041862acc9e8158b2d0a14ecbfc73e5074 (diff)
downloadpub-docs-6d0354fccb7f3043446078521333c2724c2f8d0c.tar.gz
pub-docs-6d0354fccb7f3043446078521333c2724c2f8d0c.tar.bz2
pub-docs-6d0354fccb7f3043446078521333c2724c2f8d0c.zip
rss generator
Diffstat (limited to 'update.sh')
-rwxr-xr-xupdate.sh29
1 files changed, 28 insertions, 1 deletions
diff --git a/update.sh b/update.sh
index 687c805..0e695a6 100755
--- a/update.sh
+++ b/update.sh
@@ -1,12 +1,37 @@
-#!/bin/sh
+#!/bin/bash
+
+# RSS
+RSS_TITLE='pub-docs'
+RSS_TITLE_LINK='https://omeckman.net/pub-docs/'
+RSS_TITLE_DESC='public documents'
+RSS_MY_URL=${RSS_TITLE_LINK}
cp INDEX_template.md INDEX.md
+cp template_rss_header.xml index.xml
+
+#sed -i "s/\\\$TITLE</${RSS_TITLE}</g" index.xml
+python3 pyreplace.py '$TITLE$' "${RSS_TITLE}" index.xml
+python3 pyreplace.py '$TITLE_LINK$' "$RSS_TITLE_LINK" index.xml
+python3 pyreplace.py '$TITLE_DESC$' "${RSS_TITLE_DESC}" index.xml
+python3 pyreplace.py '$MY_URL$' "${RSS_MY_URL}" index.xml
+
for i in *.md
do
filename_wo_ext=$(echo "$i" | cut -f 1 -d '.')
if [ $filename_wo_ext != "template" ] && [ $filename_wo_ext != "INDEX_template" ]
then
+
+ RSS_ITEM_TITLE="$filename_wo_ext"
+ RSS_ITEM_LINK=${RSS_TITLE_LINK}${i}
+ RSS_ITEM_PUBDATE=""
+ RSS_ITEM_DESC=$RSS_ITEM_TITLE
+ cat template_rss_item.xml >> index.xml
+ python3 pyreplace.py '$ITEM_TITLE$' "${RSS_ITEM_TITLE}" index.xml
+ python3 pyreplace.py '$ITEM_LINK$' "${RSS_ITEM_LINK}" index.xml
+ python3 pyreplace.py '$ITEM_PUBDATE$' "${RSS_ITEM_PUIBDATE}" index.xml
+ python3 pyreplace.py '$ITEM_DESC$' "${RSS_ITEM_DESC}" index.xml
+
pandoc $i -s --highlight-style pygments --css=style.css --self-contained -t html5 -o $filename_wo_ext.html
if [ $filename_wo_ext != "INDEX" ]
@@ -17,4 +42,6 @@ do
fi
done
+cat template_rss_footer.xml >> index.xml
+
ln -s INDEX.html index.html
in each repos: see "about"-tab (if existing) for more details / README.
mailto contact at omeckman dot net
all timestamps in UTC (German winter time: UTC+01:00, summer time: UTC+02:00)
dark theme is a modded version of: https://gist.github.com/Yoplitein/f4b671a2ec70c9e743fa