diff options
author | Max Magorsch <arzano@gentoo.org> | 2020-03-09 15:02:55 +0100 |
---|---|---|
committer | Max Magorsch <arzano@gentoo.org> | 2020-03-09 15:02:55 +0100 |
commit | 0adf2560a9f5b71e95e695f5e86909e62c7140d3 (patch) | |
tree | abf6d3f17a03acf0f845869732172915a295a7d4 | |
parent | Fix minor typo in contributors page (diff) | |
download | planet-tyrian-0adf2560a9f5b71e95e695f5e86909e62c7140d3.tar.gz planet-tyrian-0adf2560a9f5b71e95e695f5e86909e62c7140d3.tar.bz2 planet-tyrian-0adf2560a9f5b71e95e695f5e86909e62c7140d3.zip |
Add rss and atom feeds
Signed-off-by: Max Magorsch <arzano@gentoo.org>
-rw-r--r-- | atom.universe.xml.erb | 60 | ||||
-rw-r--r-- | atom.xml.erb | 62 | ||||
-rw-r--r-- | rss20.universe.xml.erb | 33 | ||||
-rw-r--r-- | rss20.xml.erb | 35 | ||||
-rw-r--r-- | tyrian.html.erb | 6 | ||||
-rw-r--r-- | tyrian.txt | 4 |
6 files changed, 198 insertions, 2 deletions
diff --git a/atom.universe.xml.erb b/atom.universe.xml.erb new file mode 100644 index 0000000..a73045c --- /dev/null +++ b/atom.universe.xml.erb @@ -0,0 +1,60 @@ +<% require 'loofah' %><?xml version="1.0"?> +<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> +<generator uri="https://github.com/feedreader">Pluto</generator> + <author> + <name>Welcome to <b>Planet Gentoo</b>, an aggregation of Gentoo-related weblog articles written by Gentoo developers. For a broader range of topics, you might be interested in <a href="https://planet.gentoo.org/universe/">Gentoo Universe</a>.</name> + <email>planet@gentoo.org</email> + </author> + <id>https://planet.gentoo.org/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"/> + +<% + items = site.items.latest.limit(50) + ItemCursor.new(items).each do |item, new_date, new_feed| +%> + <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"> + <% 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"> + <% if item.content %> + <%= CGI::escapeHTML(Loofah.fragment(item.content).scrub!(:prune).to_s) %> + <% elsif item.summary %> + <%= CGI::escapeHTML(Loofah.fragment(item.summary).scrub!(:prune).to_s) %> + <% else %> + -/- + <% end %> + </div> + </content> + + <author> + <%= CGI::escapeHTML(item.feed.title) %> + </author> + <source> + <id><%= CGI::escapeHTML(item.feed.url) %></id> + <link href="<%= CGI::escapeHTML(item.url) %>" rel="self" type="application/rss+xml" /> + <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> + </source> + + </entry> +<% end %> + + +</feed> diff --git a/atom.xml.erb b/atom.xml.erb new file mode 100644 index 0000000..0d10ebf --- /dev/null +++ b/atom.xml.erb @@ -0,0 +1,62 @@ +<?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> +<generator uri="https://github.com/feedreader">Pluto</generator> + <author> + <name>Welcome to <b>Planet Gentoo</b>, an aggregation of Gentoo-related weblog articles written by Gentoo developers. For a broader range of topics, you might be interested in <a href="https://planet.gentoo.org/universe/">Gentoo Universe</a>.</name> + <email>planet@gentoo.org</email> + </author> + <id>https://planet.gentoo.org/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"/> + +<% + items = site.items.latest.limit(50) + ItemCursor.new(items).each do |item, new_date, new_feed| +%> +<% if item.feed.location == "planet" %> + <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"> + <% 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"> + <% if item.content %> + <%= CGI::escapeHTML(Loofah.fragment(item.content).scrub!(:prune).to_s) %> + <% elsif item.summary %> + <%= CGI::escapeHTML(Loofah.fragment(item.summary).scrub!(:prune).to_s) %> + <% else %> + -/- + <% end %> + </div> + </content> + + <author> + <%= CGI::escapeHTML(item.feed.title) %> + </author> + <source> + <id><%= CGI::escapeHTML(item.feed.url) %></id> + <link href="<%= CGI::escapeHTML(item.url) %>" rel="self" type="application/rss+xml" /> + <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> + </source> + + </entry> +<% end %> +<% end %> + + +</feed> diff --git a/rss20.universe.xml.erb b/rss20.universe.xml.erb new file mode 100644 index 0000000..60c36f1 --- /dev/null +++ b/rss20.universe.xml.erb @@ -0,0 +1,33 @@ +<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"> +<channel> +<title>Planet Gentoo</title> +<link>https://planet.gentoo.org</link> +<language>en</language> +<description>Planet Gentoo - https://planet.gentoo.org/</description> +<% + require 'loofah' + require 'cgi' + items = site.items.latest.limit(50) + ItemCursor.new(items).each do |item, new_date, new_feed| +%> + <item> + <title><%= CGI::escapeHTML(item.title) %></title> + <guid isPermaLink="false"><%= CGI::escapeHTML(item.guid) %></guid> + <link><%= CGI::escapeHTML(item.url) %></link> + <description> + <% if item.content %> + <%= CGI::escapeHTML(Loofah.fragment(item.content).scrub!(:prune).to_s) %> + <% elsif item.summary %> + <%= CGI::escapeHTML(Loofah.fragment(item.summary).scrub!(:prune).to_s) %> + <% else %> + -/- + <% end %> + </description> + <pubDate><%= item.published.strftime('%a, %d %b %Y %H:%M:%S %z') %></pubDate> + <dc:creator><%= CGI::escapeHTML(item.feed.title) %> (<%= CGI::escapeHTML(item.feed.key) %>)</dc:creator> + </item> +<% end %> + + +</channel> +</rss> diff --git a/rss20.xml.erb b/rss20.xml.erb new file mode 100644 index 0000000..04b19b4 --- /dev/null +++ b/rss20.xml.erb @@ -0,0 +1,35 @@ +<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"> +<channel> +<title>Planet Gentoo</title> +<link>https://planet.gentoo.org</link> +<language>en</language> +<description>Planet Gentoo - https://planet.gentoo.org/</description> +<% + require 'loofah' + require 'cgi' + items = site.items.latest.limit(50) + ItemCursor.new(items).each do |item, new_date, new_feed| +%> +<% if item.feed.location == "planet" %> + <item> + <title><%= CGI::escapeHTML(item.title) %></title> + <guid isPermaLink="false"><%= CGI::escapeHTML(item.guid) %></guid> + <link><%= CGI::escapeHTML(item.url) %></link> + <description> + <% if item.content %> + <%= CGI::escapeHTML(Loofah.fragment(item.content).scrub!(:prune).to_s) %> + <% elsif item.summary %> + <%= CGI::escapeHTML(Loofah.fragment(item.summary).scrub!(:prune).to_s) %> + <% else %> + -/- + <% end %> + </description> + <pubDate><%= item.published.strftime('%a, %d %b %Y %H:%M:%S %z') %></pubDate> + <dc:creator><%= CGI::escapeHTML(item.feed.title) %> (<%= CGI::escapeHTML(item.feed.key) %>)</dc:creator> + </item> +<% end %> +<% end %> + + +</channel> +</rss> diff --git a/tyrian.html.erb b/tyrian.html.erb index 20ad499..90c0fce 100644 --- a/tyrian.html.erb +++ b/tyrian.html.erb @@ -25,8 +25,10 @@ <link rel="search" type="application/opensearchdescription+xml" href="https://www.gentoo.org/search/bugs-gentoo-org.xml" title="Gentoo Bugzilla"> <link rel="search" type="application/opensearchdescription+xml" href="https://www.gentoo.org/search/packages-gentoo-org.xml" title="Gentoo Packages"> <link rel="search" type="application/opensearchdescription+xml" href="https://www.gentoo.org/search/archives-gentoo-org.xml" title="Gentoo List Archives"> - <link rel="alternate" type="application/rss+xml" title="Planet Gentoo" href="https://planet.gentoo.org/universe/rss20.xml"> - <link rel="alternate" type="application/atom+xml" title="Planet Gentoo" href="https://planet.gentoo.org/universe/atom.xml"> + <link rel="alternate" type="application/rss+xml" title="Planet Gentoo" href="https://planet.gentoo.org/rss20.xml"> + <link rel="alternate" type="application/rss+xml" title="Gentoo Universe" href="https://planet.gentoo.org/universe/rss20.xml"> + <link rel="alternate" type="application/atom+xml" title="Planet Gentoo" href="https://planet.gentoo.org/atom.xml"> + <link rel="alternate" type="application/atom+xml" title="Gentoo Universe" href="https://planet.gentoo.org/universe/atom.xml"> </head> @@ -5,6 +5,10 @@ search.html tyrian-search.html.erb contributors.html tyrian-contributors.html.erb data.html data.html.erb data.json data.json.erb +rss20.xml rss20.xml.erb +universe/rss20.xml rss20.universe.xml.erb +atom.xml atom.xml.erb +universe/atom.xml atom.universe.xml.erb tyrian/tyrian.min.css ../@gentoo/tyrian/dist/tyrian.min.css |