made the blog rss actually work

This commit is contained in:
/dev/urandom 2021-04-06 17:17:37 +03:00
parent 0d821ad644
commit a2bc5a758a

View file

@ -49,7 +49,7 @@ done
FILES=`cat blogdates.txt | sort -nr | cut -f 2-` FILES=`cat blogdates.txt | sort -nr | cut -f 2-`
cat << RSSHEADER cat << RSSHEADER
<?xml version="1.0" encoding=\"UTF-8\" ?> <?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0"> <rss version="2.0">
<channel> <channel>
<title>rnd's blog</title> <title>rnd's blog</title>
@ -70,7 +70,7 @@ for f in $FILES; do
echo "<item>" echo "<item>"
echo "<title>$TITLE</title>" echo "<title>$TITLE</title>"
echo "<link>$OUTPAGE</link>" echo "<link>https://rnd.neocities.org/blog/$OUTPAGE</link>"
if [ $MTIME -gt 0 ]; then if [ $MTIME -gt 0 ]; then
RDATE=`date -R -u -d @$MTIME` RDATE=`date -R -u -d @$MTIME`
@ -79,15 +79,16 @@ for f in $FILES; do
fi fi
echo "<pubdate>$RDATE</pubdate>" echo "<pubdate>$RDATE</pubdate>"
fi fi
echo "</item>"
DESCRIPTION="`printcut $f`" DESCRIPTION="`printcut $f`"
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
DESC_HTML=`echo "$DESCRIPTION" | markdown` DESC_HTML=`echo "$DESCRIPTION" | markdown`
echo "<description>$DESC_HTML</description>" echo "<description>$DESC_HTML</description>"
fi fi
echo "</item>"
done done
cat << RSSFOOTER cat << RSSFOOTER
</channel> </channel>
</rss>
RSSFOOTER RSSFOOTER