protoadandsuperbowl/rss.sh

17 lines
630 B
Bash
Executable File

#bin/sh
echo "<rss version=\"2.0\"><channel><title>It's Pro Toad and Superb Owl</title>" > feed.xml
for f in $(find . -type f -iname '*.md' ! -name 'README.md' | sed 's/\.\///'); do
echo "<item>" >> feed.xml
echo "<title>$f</title>" >> feed.xml
echo "<link>https://git.tilde.town/dozens/protoadandsuperbowl/raw/branch/master/$f</link>" >> feed.xml
echo "<pubDate>$(stat -f "%m%t%Sm %N" $f | cut -f2 | cut -f1-4 -d ' ')</pubDate>" >> feed.xml
echo "<description><![CDATA[" >> feed.xml
pandoc $f >> feed.xml
echo "]]></description>" >> feed.xml
echo "</item>" >> feed.xml
done
echo '</channel></rss>' >> feed.xml