Exclude <article> tags from post html in RSS feed

master
Hugo Thunnissen 4 years ago
parent 13f31546fc
commit 86fce3a06a

@ -5,14 +5,13 @@
<link>https://hugot.nl/blog.html</link>
<description>Hugo's personal blog</description>
<language>en-us</language>
<pubDate>Thu, 16 Apr 2020 08:18:31 +0200</pubDate>
<lastBuildDate>Thu, 16 Apr 2020 08:18:31 +0200</lastBuildDate>
<pubDate>Thu, 16 Apr 2020 08:36:12 +0200</pubDate>
<lastBuildDate>Thu, 16 Apr 2020 08:36:12 +0200</lastBuildDate>
<docs>http://blogs.law.harvard.edu/tech/rss</docs>
<generator>Hugo's Custom Bash Script</generator>
<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;
<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;h1&gt;
How To Use Your Email Client For Physical Mail
&lt;/h1&gt;
&lt;p&gt;
@ -121,13 +120,11 @@
, but I
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 +0100</pubDate><guid isPermaLink="false"> How To Use Your Email Client For Physical Mail NDc2MDg1MjYxIDQxODUK</guid>
&lt;/p&gt;</description><pubDate>Mon, 17 Feb 2020 11:55:42 +0100</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 +0100</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;
<item><title> Introduction </title><link>https://hugot.nl/posts/introduction/index.html</link><description> &lt;h1&gt;
Introduction
&lt;/h1&gt;
&lt;p&gt;
@ -158,8 +155,7 @@
&lt;/p&gt;
&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 +0100</pubDate><guid isPermaLink="false"> Introduction MzYzMzkyNDgwOCA5MDcK</guid>
&lt;/p&gt;</description><pubDate>Sat, 08 Feb 2020 09:30:06 +0100</pubDate><guid isPermaLink="false"> Introduction MzYzMzkyNDgwOCA5MDcK</guid>
</item>
</channel>
</rss>

@ -139,7 +139,7 @@ while read -r post_html; do
# Escape just the article element for use in the RSS feed article description.
# This way the entire article can be read from an RSS reader.
article_html="$(pup article < "$post_html" | escape-html)"
article_html="$(pup article < "$post_html" | head -n -1 | tail -n +2 | escape-html)"
# Escape the post html file name to safely use it in the generated html.
href="$(escape-html <<<"$post_html")" || exit $?

Loading…
Cancel
Save