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>
<description>Hugo's personal blog</description>
<language>en-us</language>
<pubDate>Sat 08 Feb 2020 09:58:35 AM CET</pubDate>
<lastBuildDate>Sat 08 Feb 2020 09:58:35 AM CET</lastBuildDate>
<pubDate>Sat 08 Feb 2020 10:07:44 AM CET</pubDate>
<lastBuildDate>Sat 08 Feb 2020 10:07:44 AM CET</lastBuildDate>
<docs>http://blogs.law.harvard.edu/tech/rss</docs>
<generator>Hugo's Custom Bash Script</generator>
<managingEditor>social@hugot.nl</managingEditor>
<webMaster>infra@hugot.nl</webMaster>
<title> Introduction </title>
<description> Hello, welcome to my blog! My name is Hugo. I am a 22 year old Software
<item><title> Introduction </title><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
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
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>
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>
</channel>
</rss>

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

Loading…
Cancel
Save