Fix missing <item> tag and remove unnecessary whitespace from feed generation

master
Hugo Thunnissen 4 years ago
parent 748539587c
commit 38769172ac

@ -5,19 +5,16 @@
<link>https://hugot.nl/blog.html</link> <link>https://hugot.nl/blog.html</link>
<description>Hugo's personal blog</description> <description>Hugo's personal blog</description>
<language>en-us</language> <language>en-us</language>
<pubDate>Sat 08 Feb 2020 09:58:35 AM CET</pubDate> <pubDate>Sat 08 Feb 2020 10:07:44 AM CET</pubDate>
<lastBuildDate>Sat 08 Feb 2020 09:58:35 AM CET</lastBuildDate> <lastBuildDate>Sat 08 Feb 2020 10:07:44 AM CET</lastBuildDate>
<docs>http://blogs.law.harvard.edu/tech/rss</docs> <docs>http://blogs.law.harvard.edu/tech/rss</docs>
<generator>Hugo's Custom Bash Script</generator> <generator>Hugo's Custom Bash Script</generator>
<managingEditor>social@hugot.nl</managingEditor> <managingEditor>social@hugot.nl</managingEditor>
<webMaster>infra@hugot.nl</webMaster> <webMaster>infra@hugot.nl</webMaster>
<title> Introduction </title> <item><title> Introduction </title><description>Hello, welcome to my blog! My name is Hugo. I am a 22 year old Software
<description> Hello, welcome to my blog! My name is Hugo. I am a 22 year old Software
Engineering student from the Netherlands. Software development is a huge part Engineering student from the Netherlands. Software development is a huge part
of my life, I write a lot of (weird) programs to scratch my own itch and most of my life, I write a lot of (weird) programs to scratch my own itch and most
software I create is open_source by default. I also run a one-man company that software I create is open_source by default. I also run a one-man company that
provides some IT services on the side. </description> provides some IT services on the side.</description><pubDate>Sat 08 Feb 2020 09:30:06 AM CET</pubDate><guid>./posts/introduction/index.html#MjM3MzUyOTAwNSA5MDYK</guid></item>
<pubDate> Sat 08 Feb 2020 09:30:06 AM CET </pubDate>
<guid> ./posts/introduction/index.html#MjM3MzUyOTAwNSA5MDYK </guid>
</channel> </channel>
</rss> </rss>

@ -115,7 +115,9 @@ el-enclose() {
element_name="$1" element_name="$1"
shift shift
echo "<$element_name>" "$@" "</$element_name>" printf '%s' "<$element_name>"
printf '%s' "$@"
printf '%s' "</$element_name>"
} }
site_url="https://hugot.nl" site_url="https://hugot.nl"
@ -173,10 +175,13 @@ while read -r post_html; do
} >> "$new_html" } >> "$new_html"
{ {
el item
el-enclose title "$title" el-enclose title "$title"
el-enclose description "$excerpt" el-enclose description "$excerpt"
el-enclose pubDate "$pubdate" el-enclose pubDate "$pubdate"
el-enclose guid "${href}#$(base64 <(cksum <<<"$text"))" el-enclose guid "${href}#$(base64 <(cksum <<<"$text"))"
el-close item
} >> "$new_rss" } >> "$new_rss"
done < "$posts_file" done < "$posts_file"

Loading…
Cancel
Save