sbs

A Simple Blogging System.
git clone https://git.sr.ht/~jbauer/sbs
Log | Files | Refs | README | LICENSE

commit 65ab9ca6dcc03e2ef24f7237403dd5c648b65468
parent e2af53afe660c7add083a724bfebcae77a0b8796
Author: Jake Bauer <jbauer@paritybit.ca>
Date:   Tue, 15 Feb 2022 00:31:45 -0500

Fix Atom feed generation

It now validates with https://validator.w3.org/feed/ and produces proper
embedded HTML output.

Diffstat:
Msbs | 7++++---
1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/sbs b/sbs @@ -81,6 +81,7 @@ elif [ "$1" = "genfeed" ]; then printf '<feed xmlns="http://www.w3.org/2005/Atom">\n' >> static/feed.xml printf "\t<title>$siteName</title>\n" >> static/feed.xml printf "\t<link href=\"$siteURL\" />\n" >> static/feed.xml + printf "\t<link rel=\"self\" href=\"${siteURL}feed.xml\" />\n" >> static/feed.xml printf "\t<icon>/favicon.png</icon>\n" >> static/feed.xml printf "\t<updated>$(date +"%Y-%m-%dT%H:%M:%S%:z")</updated>\n" >> static/feed.xml printf "\t<id>$siteURL</id>\n" >> static/feed.xml @@ -106,10 +107,10 @@ elif [ "$1" = "genfeed" ]; then printf "\t<entry>\n" >> static/feed.xml printf "\t\t<title>$title</title>\n" >> static/feed.xml printf "\t\t<author><name>$author</name></author>\n" >> static/feed.xml - printf "\t\t<link>$siteURL/$subDir/$fileName</link>\n" >> static/feed.xml - printf "\t\t<id>$siteURL/$subDir/$fileName</id>\n" >> static/feed.xml + printf "\t\t<link href=\"$siteURL$subDir/$fileName\" />\n" >> static/feed.xml + printf "\t\t<id>$siteURL$subDir/$fileName</id>\n" >> static/feed.xml printf "\t\t<updated>$(date -d "$date" +"%Y-%m-%dT%H:%M:%S%:z")</updated>\n" >> static/feed.xml - printf "\t\t<content type=\"html\">\n%s\n\t\t</content>\n" "$(lowdown $buildOptions "$file")" >> static/feed.xml + printf "\t\t<content type=\"text\"><![CDATA[\n%s\n\t\t]]></content>\n" "$(lowdown $buildOptions "$file")" >> static/feed.xml printf "\t</entry>\n\n" >> static/feed.xml numEntries=$((numEntries+1))