aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Magorsch <arzano@gentoo.org>2020-03-09 16:01:39 +0100
committerMax Magorsch <arzano@gentoo.org>2020-03-09 16:01:39 +0100
commitaf6a740884311e7e3d4deff54f8d733e28fa4b9f (patch)
tree585becadd8e187a9d5267d23657343b8681d8675
parentAdd rss and atom feeds (diff)
downloadplanet-tyrian-af6a740884311e7e3d4deff54f8d733e28fa4b9f.tar.gz
planet-tyrian-af6a740884311e7e3d4deff54f8d733e28fa4b9f.tar.bz2
planet-tyrian-af6a740884311e7e3d4deff54f8d733e28fa4b9f.zip
Fix the atom feeds so that they are valid
Signed-off-by: Max Magorsch <arzano@gentoo.org>
-rw-r--r--atom.universe.xml.erb23
-rw-r--r--atom.xml.erb19
2 files changed, 20 insertions, 22 deletions
diff --git a/atom.universe.xml.erb b/atom.universe.xml.erb
index a73045c..a94ad98 100644
--- a/atom.universe.xml.erb
+++ b/atom.universe.xml.erb
@@ -1,13 +1,13 @@
-<% require 'loofah' %><?xml version="1.0"?>
+<?xml version="1.0"?><% require 'loofah' %><% require 'cgi' %>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:planet="http://planet.intertwingly.net/" xmlns:indexing="urn:atom-extension:indexing" indexing:index="no"><access:restriction xmlns:access="http://www.bloglines.com/about/specs/fac-1.0" relationship="deny"/>
<title>Planet Gentoo</title>
-<updated><%= site.items.latest.limit(50).first.published.strftime('%FT%T%:z ') %></updated>
+<updated><%= site.items.latest.limit(50).first.published.strftime('%FT%T%:z') %></updated>
<generator uri="https://github.com/feedreader">Pluto</generator>
<author>
<name>Welcome to &lt;b&gt;Planet Gentoo&lt;/b&gt;, an aggregation of Gentoo-related weblog articles written by Gentoo developers. For a broader range of topics, you might be interested in &lt;a href="https://planet.gentoo.org/universe/"&gt;Gentoo Universe&lt;/a&gt;.</name>
<email>planet@gentoo.org</email>
</author>
- <id>https://planet.gentoo.org/atom.xml</id>
+ <id>https://planet.gentoo.org/universe/atom.xml</id>
<link href="https://planet.gentoo.org/atom.xml" rel="self" type="application/atom+xml"/>
<link href="https://planet.gentoo.org/" rel="alternate"/>
@@ -18,19 +18,17 @@
<entry xml:lang="en-US">
<id><%= CGI::escapeHTML(item.url) %></id>
<link href="<%= CGI::escapeHTML(item.url) %>" rel="alternate" type="text/html" />
- <title><%= CGI::escapeHTML(item.title) %></title>
- <summary type="xhtml">
- <div xmlns="http://www.w3.org/1999/xhtml">
+ <title type="html"><%= CGI::escapeHTML(item.title) %></title>
+ <summary type="html">
<% if item.summary %>
<%= CGI::escapeHTML(Loofah.fragment(item.summary).scrub!(:prune).to_s) %>
<% else %>
-/-
<% end %>
- </div>
</summary>
- <content type="xhtml">
- <div xmlns="http://www.w3.org/1999/xhtml">
+ <content type="html">
+
<% if item.content %>
<%= CGI::escapeHTML(Loofah.fragment(item.content).scrub!(:prune).to_s) %>
<% elsif item.summary %>
@@ -38,11 +36,11 @@
<% else %>
-/-
<% end %>
- </div>
+
</content>
<author>
- <%= CGI::escapeHTML(item.feed.title) %>
+ <name><%= CGI::escapeHTML(item.feed.title) %></name>
</author>
<source>
<id><%= CGI::escapeHTML(item.feed.url) %></id>
@@ -50,8 +48,9 @@
<link href="<%= CGI::escapeHTML(item.feed.url) %>" rel="alternate" type="text/html" />
<subtitle></subtitle>
<title><%= CGI::escapeHTML(item.title) %></title>
- <updated><updated><%= item.published.strftime('%FT%T%:z ') %></updated></updated>
+ <updated><%= item.published.strftime('%FT%T%:z') %></updated>
</source>
+ <updated><%= item.published.strftime('%FT%T%:z') %></updated>
</entry>
<% end %>
diff --git a/atom.xml.erb b/atom.xml.erb
index 0d10ebf..03b8288 100644
--- a/atom.xml.erb
+++ b/atom.xml.erb
@@ -1,7 +1,7 @@
<?xml version="1.0"?><% require 'loofah' %><% require 'cgi' %>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:planet="http://planet.intertwingly.net/" xmlns:indexing="urn:atom-extension:indexing" indexing:index="no"><access:restriction xmlns:access="http://www.bloglines.com/about/specs/fac-1.0" relationship="deny"/>
<title>Planet Gentoo</title>
-<updated><%= site.items.latest.limit(50).first.published.strftime('%FT%T%:z ') %></updated>
+<updated><%= site.items.latest.limit(50).first.published.strftime('%FT%T%:z') %></updated>
<generator uri="https://github.com/feedreader">Pluto</generator>
<author>
<name>Welcome to &lt;b&gt;Planet Gentoo&lt;/b&gt;, an aggregation of Gentoo-related weblog articles written by Gentoo developers. For a broader range of topics, you might be interested in &lt;a href="https://planet.gentoo.org/universe/"&gt;Gentoo Universe&lt;/a&gt;.</name>
@@ -19,19 +19,17 @@
<entry xml:lang="en-US">
<id><%= CGI::escapeHTML(item.url) %></id>
<link href="<%= CGI::escapeHTML(item.url) %>" rel="alternate" type="text/html" />
- <title><%= CGI::escapeHTML(item.title) %></title>
- <summary type="xhtml">
- <div xmlns="http://www.w3.org/1999/xhtml">
+ <title type="html"><%= CGI::escapeHTML(item.title) %></title>
+ <summary type="html">
<% if item.summary %>
<%= CGI::escapeHTML(Loofah.fragment(item.summary).scrub!(:prune).to_s) %>
<% else %>
-/-
<% end %>
- </div>
</summary>
- <content type="xhtml">
- <div xmlns="http://www.w3.org/1999/xhtml">
+ <content type="html">
+
<% if item.content %>
<%= CGI::escapeHTML(Loofah.fragment(item.content).scrub!(:prune).to_s) %>
<% elsif item.summary %>
@@ -39,11 +37,11 @@
<% else %>
-/-
<% end %>
- </div>
+
</content>
<author>
- <%= CGI::escapeHTML(item.feed.title) %>
+ <name><%= CGI::escapeHTML(item.feed.title) %></name>
</author>
<source>
<id><%= CGI::escapeHTML(item.feed.url) %></id>
@@ -51,8 +49,9 @@
<link href="<%= CGI::escapeHTML(item.feed.url) %>" rel="alternate" type="text/html" />
<subtitle></subtitle>
<title><%= CGI::escapeHTML(item.title) %></title>
- <updated><updated><%= item.published.strftime('%FT%T%:z ') %></updated></updated>
+ <updated><%= item.published.strftime('%FT%T%:z') %></updated>
</source>
+ <updated><%= item.published.strftime('%FT%T%:z') %></updated>
</entry>
<% end %>