#!/usr/bin/env bash # Makes RSS feed (feed.xml) # Currently missing description and pubDate # Based off https://en.wikipedia.org/wiki/RSS, particularly the example # TODO: update to get metadata from another file, or maybe to automatically extract it from the Markdown or HTML files # TODO: Add dates for each page via Git history printf "\n\n\n\n eng.askiiart.net\n This is the feed for engl.askiiart.net, I guess\n https://askiiart.net\n $(TZ='UTC' date --rfc-2822)" >feed.xml find . -path ./error -prune -o -name '*.html' -print | while read -r item; do # Skip template.html and index.html if [[ ${item} == "./index.html" || ${item} == "./template.html" ]]; then continue fi item="${item%.*}" item="${item#./}" TITLE=$(grep -m 1 -oP '(?<=^# ).*' ${item}.md | cat) printf "\n \n ${TITLE}\n https://engl.askiiart.net/${item}.html\n " >>feed.xml done printf "\n\n\n" >>feed.xml