Improve formatting in RSS feed, to make it valid
This commit is contained in:
@@ -116,7 +116,12 @@ post_contents
|
||||
|> File.close()
|
||||
end)
|
||||
|
||||
stripForRSS = fn content -> content
|
||||
|> String.replace("\n", "")
|
||||
end
|
||||
|
||||
post_feed = post_contents
|
||||
|> Enum.map(fn m -> Map.update!(m, :content, stripForRSS) end)
|
||||
|> Enum.sort_by(fn m -> Map.get(m, :date) end)
|
||||
|> Enum.reverse()
|
||||
|> Enum.map(fill_template_pretemplated.(post_feed_item_template))
|
||||
|
||||
@@ -2,13 +2,8 @@
|
||||
<title>{{title}}</title>
|
||||
<link>https://raymon.dev/posts/{{localpath}}.html</link>
|
||||
<guid>https://raymon.dev/posts/{{localpath}}.html</guid>
|
||||
<description>
|
||||
<![CDATA[
|
||||
{{content}}
|
||||
]]>
|
||||
</description>
|
||||
<content type="html">
|
||||
{{content}}
|
||||
</content>
|
||||
<pubDate>{{date}}</pubDate>
|
||||
<description><![CDATA[
|
||||
{{content}}
|
||||
]]></description>
|
||||
</item>
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
|
||||
<channel>
|
||||
<atom:link href="https://raymon.dev/posts/rss.xml" rel="self" type="application/rss+xml" />
|
||||
<title>Posts</title>
|
||||
<link>https://raymon.dev</link>
|
||||
<title>Raymon Zutekouw</title>
|
||||
<description>Personal blog</description>
|
||||
<language>en-us</language>
|
||||
|
||||
<link>https://raymon.dev</link>
|
||||
<atom:link href="https://raymon.dev/posts/rss.xml" rel="self" type="application/rss+xml" />
|
||||
{{items}}
|
||||
</channel>
|
||||
</rss>
|
||||
|
||||
Reference in New Issue
Block a user