Add other RSS feeds

This commit is contained in:
askiiart 2023-10-15 12:38:53 -05:00
parent 67f54b7c02
commit ee00ac3429
Signed by untrusted user who does not match committer: askiiart
GPG key ID: BC3800E55FB54D67
5 changed files with 64 additions and 2 deletions

View file

@ -14,4 +14,30 @@ find . -name "*.html" | while read -r item; do
TITLE=$(grep -m 1 -oP '(?<=^# ).*' ${item}.md | cat)
printf "\n <item>\n <title>${TITLE}</title>\n <link>https://askiiart.net/${item}.html</link>\n </item>" >>feed.xml
done
printf "\n\n</channel>\n</rss>" >>feed.xml
printf "\n\n</channel>\n</rss>" >>feed.xml
# same thing, but for TIL only
cd ./til
printf "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n<rss version=\"2.0\">\n\n<channel>\n <title>askiiart.net TIL</title>\n <description>The feed for askiiart.net but just TIL, I guess</description>\n <link>https://askiiart.net/til/</link>\n <lastBuildDate>$(TZ='UTC' date --rfc-2822)</lastBuildDate>" >feed.xml
find . -name "*.html" | while read -r item; do
# Skip template.html, wishlist.html, resume.html, and portfolio.html
item="${item%.*}"
item="${item#./}"
TITLE=$(grep -m 1 -oP '(?<=^# ).*' ${item}.md | cat)
printf "\n <item>\n <title>${TITLE}</title>\n <link>https://askiiart.net/til/${item}.html</link>\n </item>" >>feed.xml
done
printf "\n\n</channel>\n</rss>" >>feed.xml
cd ..
# same thing, but for blog only
cd ./blog
printf "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n<rss version=\"2.0\">\n\n<channel>\n <title>askiiart.net blog</title>\n <description>The feed for askiiart.net but just the blog, I guess</description>\n <link>https://askiiart.net/blog/</link>\n <lastBuildDate>$(TZ='UTC' date --rfc-2822)</lastBuildDate>" >feed.xml
find . -name "*.html" | while read -r item; do
# Skip template.html, wishlist.html, resume.html, and portfolio.html
item="${item%.*}"
item="${item#./}"
TITLE=$(grep -m 1 -oP '(?<=^# ).*' ${item}.md | cat)
printf "\n <item>\n <title>${TITLE}</title>\n <link>https://askiiart.net/til/${item}.html</link>\n </item>" >>feed.xml
done
printf "\n\n</channel>\n</rss>" >>feed.xml
cd ..