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