pandoc-blog/bin/build-feed.sh

20 lines
628 B
Bash
Executable File

#!/bin/zsh
title=blog
description="yrafn afuynta arr a ar"
baseurl="http://tilde.town/~dozens/gamelog"
link="$baseurl/index.html"
href="$baseurl/feed.xml"
outfile="dist/feed.xml"
echo "<rss version=\"2.0\"><channel><title>$title</title>" > $outfile
echo "<link>$link</link><description>$description</description><atom:link rel=\"self\" type=\"application/rss+xml\" href=\"$href\"/>" >> $outfile
for file in $(ls -1 content/*.md | sort -r)
do
dest="${$(basename $file)/md/html}"
pandoc --template=templates/rss-feed-item.template --variable=url:"$baseurl/$dest" $file >> $outfile
done
echo '</channel></rss>' >> $outfile