diff --git a/feed.xml b/feed.xml new file mode 100644 index 0000000..7089052 --- /dev/null +++ b/feed.xml @@ -0,0 +1,39 @@ + + + + + askiiart.net + The feed for askiiart.net, I guess + https://askiiart.net + Mon, 25 Sep 2023 19:29:33 +0000 + + Portfolio + https://askiiart.net/portfolio.html + + + Marlin Boot Animations + https://askiiart.net/blog/marlin-boot-animations.html + + + askiiart's site + https://askiiart.net/index.html + + + My Stack + https://askiiart.net/stack.html + + + Wishlist + https://askiiart.net/wishlist.html + + + Resume + https://askiiart.net/resume.html + + + Using JSON with docker compose + https://askiiart.net/til/using-json-with-docker-compose.html + + + + \ No newline at end of file diff --git a/md2html.sh b/md2html.sh index 7a02033..e14290d 100755 --- a/md2html.sh +++ b/md2html.sh @@ -1,8 +1,8 @@ #!/bin/bash set -e -dir=$(cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd) -git status --porcelain | awk 'match($1, "(M|A|\?\?)"){print $2}' | while read -r item ; do + +git status --porcelain | awk 'match($1, "(M|A|\?\?)"){print $2}' | while read -r item; do if [[ ${item} == *.md ]]; then item="${item%.*}" echo "Currently processing ${item}" @@ -10,4 +10,20 @@ git status --porcelain | awk 'match($1, "(M|A|\?\?)"){print $2}' | while read -r fi done -find . \( ! -regex './md2html.sh' \) -type f | xargs sed -i 's/sourceCode /language-/g' \ No newline at end of file +# Makes RSS feed (feed.xml) +# Currently missing description and pubDate +# Based off https://en.wikipedia.org/wiki/RSS, particularly the example +printf "\n\n\n\n askiiart.net\n The feed for askiiart.net, I guess\n https://askiiart.net\n $(TZ='UTC' date --rfc-2822)" > feed.xml +find . -name "*.html" | while read -r item; do + # Skip template.html + if [[ ${item} == "./template.html" ]]; then + continue + fi + item="${item%.*}" + item="${item#./}" + TITLE=$(grep -m 1 -oP '(?<=^# ).*' ${item}.md | cat) + printf "\n \n ${TITLE}\n https://askiiart.net/${item}.html\n " >>feed.xml +done +printf "\n\n\n" >> feed.xml + +find . \( ! -regex './md2html.sh' \) -type f | xargs sed -i 's/sourceCode /language-/g'