Use RFC 822 compliant dates in RSS feed and add real names to email fields

master
Hugo Thunnissen 4 years ago
parent 34515ddb9c
commit cfdcb42634

@ -25,7 +25,7 @@
</div>
<h1>Blog</h1>
<div><h2 style="margin-bottom: 0.1em;"><a href="posts/use-your-mail-client-for-physical-mail/index.html"> How To Use Your Email Client For Physical Mail </a></h2><i style="font-size: 0.8em;">Mon 17 Feb 2020 11:55:42 AM CET</i><p style="margin-top: 0.5em;">&lt;article&gt;
<div><h2 style="margin-bottom: 0.1em;"><a href="posts/use-your-mail-client-for-physical-mail/index.html"> How To Use Your Email Client For Physical Mail </a></h2><i style="font-size: 0.8em;">ma, 17 feb 2020 11:55:42 CET</i><p style="margin-top: 0.5em;">&lt;article&gt;
&lt;h1&gt;
How To Use Your Email Client For Physical Mail
&lt;/h1&gt;
@ -138,9 +138,9 @@
&lt;/p&gt;
&lt;/article&gt; ... <a href="posts/use-your-mail-client-for-physical-mail/index.html">Continue reading</a></p>
</div>
<hr><div><h2 style="margin-bottom: 0.1em;"><a href="posts/simple-static-blog/index.html"> Creating a Simple Static Blog </a></h2><i style="font-size: 0.8em;">Sat 08 Feb 2020 12:14:16 PM CET</i><p style="margin-top: 0.5em;"> ... <a href="posts/simple-static-blog/index.html">Continue reading</a></p>
<hr><div><h2 style="margin-bottom: 0.1em;"><a href="posts/simple-static-blog/index.html"> Creating a Simple Static Blog </a></h2><i style="font-size: 0.8em;">za, 08 feb 2020 12:14:16 CET</i><p style="margin-top: 0.5em;"> ... <a href="posts/simple-static-blog/index.html">Continue reading</a></p>
</div>
<hr><div><h2 style="margin-bottom: 0.1em;"><a href="posts/introduction/index.html"> Introduction </a></h2><i style="font-size: 0.8em;">Sat 08 Feb 2020 09:30:06 AM CET</i><p style="margin-top: 0.5em;">&lt;article&gt;
<hr><div><h2 style="margin-bottom: 0.1em;"><a href="posts/introduction/index.html"> Introduction </a></h2><i style="font-size: 0.8em;">za, 08 feb 2020 09:30:06 CET</i><p style="margin-top: 0.5em;">&lt;article&gt;
&lt;h1&gt;
Introduction
&lt;/h1&gt;

@ -5,12 +5,12 @@
<link>https://hugot.nl/blog.html</link>
<description>Hugo's personal blog</description>
<language>en-us</language>
<pubDate>do 16 apr 2020 7:43:28 CEST</pubDate>
<lastBuildDate>do 16 apr 2020 7:43:28 CEST</lastBuildDate>
<pubDate>do, 16 apr 2020 07:58:04 CEST</pubDate>
<lastBuildDate>do, 16 apr 2020 07:58:04 CEST</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>
<managingEditor>social@hugot.nl (Hugot)</managingEditor>
<webMaster>infra@hugot.nl (Hugot Infra)</webMaster>
<item><title> How To Use Your Email Client For Physical Mail </title><link>https://hugot.nl/posts/use-your-mail-client-for-physical-mail/index.html</link><description>&lt;article&gt;
&lt;h1&gt;
How To Use Your Email Client For Physical Mail
@ -122,9 +122,9 @@
don&amp;#39;t recommend using it if you don&amp;#39;t fully understand its contents, it&amp;#39;s
not a polished user experience 🤓.
&lt;/p&gt;
&lt;/article&gt;</description><pubDate>Mon 17 Feb 2020 11:55:42 AM CET</pubDate><guid isPermaLink="false"> How To Use Your Email Client For Physical Mail NDc2MDg1MjYxIDQxODUK</guid>
&lt;/article&gt;</description><pubDate>ma, 17 feb 2020 11:55:42 CET</pubDate><guid isPermaLink="false"> How To Use Your Email Client For Physical Mail NDc2MDg1MjYxIDQxODUK</guid>
</item>
<item><title> Creating a Simple Static Blog </title><link>https://hugot.nl/posts/simple-static-blog/index.html</link><description></description><pubDate>Sat 08 Feb 2020 12:14:16 PM CET</pubDate><guid isPermaLink="false"> Creating a Simple Static Blog MjU5OTIyNDIwMyA2MTI5Cg==</guid>
<item><title> Creating a Simple Static Blog </title><link>https://hugot.nl/posts/simple-static-blog/index.html</link><description></description><pubDate>za, 08 feb 2020 12:14:16 CET</pubDate><guid isPermaLink="false"> Creating a Simple Static Blog MjU5OTIyNDIwMyA2MTI5Cg==</guid>
</item>
<item><title> Introduction </title><link>https://hugot.nl/posts/introduction/index.html</link><description>&lt;article&gt;
&lt;h1&gt;
@ -159,7 +159,7 @@
&lt;p&gt;
I hope to see you around! - Hugo
&lt;/p&gt;
&lt;/article&gt;</description><pubDate>Sat 08 Feb 2020 09:30:06 AM CET</pubDate><guid isPermaLink="false"> Introduction MzYzMzkyNDgwOCA5MDcK</guid>
&lt;/article&gt;</description><pubDate>za, 08 feb 2020 09:30:06 CET</pubDate><guid isPermaLink="false"> Introduction MzYzMzkyNDgwOCA5MDcK</guid>
</item>
</channel>
</rss>

@ -67,6 +67,10 @@ print-blog-html-bottom() {
</html>'
}
rfc-822-date-time() {
date "$@" +'%a, %d %b %Y %H:%M:%S %Z'
}
# Note: pubDate and lastBuildDate are both set to the current time.
print-blog-rss-top() {
cat <<EOF
@ -77,12 +81,12 @@ print-blog-rss-top() {
<link>https://hugot.nl/blog.html</link>
<description>Hugo's personal blog</description>
<language>en-us</language>
<pubDate>$(date)</pubDate>
<lastBuildDate>$(date)</lastBuildDate>
<pubDate>$(rfc-822-date-time)</pubDate>
<lastBuildDate>$(rfc-822-date-time)</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>
<managingEditor>social@hugot.nl (Hugot)</managingEditor>
<webMaster>infra@hugot.nl (Hugot Infra)</webMaster>
EOF
}
@ -150,6 +154,9 @@ while read -r post_html; do
echo "$pubdate" > "$pubdate_file"
fi
# Convert publishing date to be conform RFC 822
pubdate="$(rfc-822-date-time --date="$pubdate")"
{
el div

Loading…
Cancel
Save