protoadandsuperbowl/bin/rss.sh

19 lines
853 B
Bash
Executable File

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