diff options
author | pux <pux@raumdock.pux.dom> | 2023-01-07 14:17:56 +0100 |
---|---|---|
committer | pux <pux@raumdock.pux.dom> | 2023-01-07 14:17:56 +0100 |
commit | 6a0dd29d364844b24f1b6dc4beb2e20b5a634ac2 (patch) | |
tree | d84e36efce0fa74989c4b31978069dc8f81fcc54 /data/update.sh | |
parent | 407572b5f49d89baad3dd0ef3d50b89a3b1ae451 (diff) | |
download | muckedout-6a0dd29d364844b24f1b6dc4beb2e20b5a634ac2.tar.gz muckedout-6a0dd29d364844b24f1b6dc4beb2e20b5a634ac2.tar.bz2 muckedout-6a0dd29d364844b24f1b6dc4beb2e20b5a634ac2.zip |
update from pub-docs
Diffstat (limited to 'data/update.sh')
-rwxr-xr-x | data/update.sh | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/data/update.sh b/data/update.sh index 687c805..e7cb139 100755 --- a/data/update.sh +++ b/data/update.sh @@ -1,7 +1,21 @@ -#!/bin/sh +#!/bin/bash + +# RSS +RSS_TITLE='omeckman.net pub-docs' +RSS_TITLE_LINK='https://omeckman.net/pub-docs/' +RSS_TITLE_DESC='omeckman.net public documents / $blog' +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 '.') @@ -12,9 +26,24 @@ do if [ $filename_wo_ext != "INDEX" ] then echo "[$filename_wo_ext]($filename_wo_ext.html) " >> INDEX.md + + origdate=$(echo "$filename_wo_ext" | cut -f 1 -d '_') + pubdaterfc822=$(python3 rfc822date.py ${origdate}) + + RSS_ITEM_TITLE="$filename_wo_ext" + RSS_ITEM_LINK=${RSS_TITLE_LINK}${filename_wo_ext}.html + RSS_ITEM_PUBDATE=${pubdaterfc822} + 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_PUBDATE}" index.xml + python3 pyreplace.py '$ITEM_DESC$' "${RSS_ITEM_DESC}" index.xml fi fi done +cat template_rss_footer.xml >> index.xml + ln -s INDEX.html index.html |