commit a9a71b687f4026f106a2b382da3c06da65b8fc17
parent 359cc142d65e738ed5fcada496b1104ee53db763
Author: Jake Bauer <jbauer@paritybit.ca>
Date: Sat, 19 Mar 2022 15:25:22 -0400
Fix atom feed embedded content type and links
Embedded content type was set to `text` when it should have been `html`
to tell clients that HTML was the format of the embedded content. It was
previously `text` because either the documentation for Atom feeds
(https://validator.w3.org/feed/docs/atom.html#text) is terrible or all
the clients do their own thing when it comes to parsing content.
Links to content weren't being properly munged so links included
`/content/blog` instead of just `/blog` and that resulted in broken
links.
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sbs b/sbs
@@ -108,7 +108,7 @@ genfeed() {
done
sort -rn "$tmp" | cut -d' ' -f2 | while read -r file; do
fileName=$(basename "$file" .md).html
- subDir=$(dirname "$file" | sed "s/^content\/?//")
+ subDir=$(dirname "$file" | sed "s/content\///")
title=$(lowdown -X title "$file")
author=$(lowdown -X author "$file")
@@ -120,7 +120,7 @@ genfeed() {
printf "\t\t<link href=\"%s%s/%s\" />\n" "$siteURL" "$subDir" "$fileName"
printf "\t\t<id>%s%s/%s</id>\n" "$siteURL" "$subDir" "$fileName"
printf "\t\t<updated>%s</updated>\n" "$(date -d "$date" +"%Y-%m-%dT%H:%M:%S%:z")"
- printf "\t\t<content type=\"text\"><![CDATA[\n%s\n\t\t]]></content>\n" "$(lowdown $buildOptions "$file")"
+ printf "\t\t<content type=\"html\"><![CDATA[\n%s\n\t\t]]></content>\n" "$(lowdown $buildOptions "$file")"
printf "\t</entry>\n\n"
} >> static/feed.xml
done