From 0adf2560a9f5b71e95e695f5e86909e62c7140d3 Mon Sep 17 00:00:00 2001 From: Max Magorsch Date: Mon, 9 Mar 2020 15:02:55 +0100 Subject: Add rss and atom feeds Signed-off-by: Max Magorsch --- atom.universe.xml.erb | 60 ++++++++++++++++++++++++++++++++++++++++++++++++ atom.xml.erb | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++ rss20.universe.xml.erb | 33 +++++++++++++++++++++++++++ rss20.xml.erb | 35 ++++++++++++++++++++++++++++ tyrian.html.erb | 6 +++-- tyrian.txt | 4 ++++ 6 files changed, 198 insertions(+), 2 deletions(-) create mode 100644 atom.universe.xml.erb create mode 100644 atom.xml.erb create mode 100644 rss20.universe.xml.erb create mode 100644 rss20.xml.erb 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' %> + +Planet Gentoo +<%= site.items.latest.limit(50).first.published.strftime('%FT%T%:z ') %> +Pluto + + 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>. + planet@gentoo.org + + https://planet.gentoo.org/atom.xml + + + +<% + items = site.items.latest.limit(50) + ItemCursor.new(items).each do |item, new_date, new_feed| +%> + + <%= CGI::escapeHTML(item.url) %> + + <%= CGI::escapeHTML(item.title) %> + +
+ <% if item.summary %> + <%= CGI::escapeHTML(Loofah.fragment(item.summary).scrub!(:prune).to_s) %> + <% else %> + -/- + <% end %> +
+
+ + +
+ <% 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 %> +
+
+ + + <%= CGI::escapeHTML(item.feed.title) %> + + + <%= CGI::escapeHTML(item.feed.url) %> + + + + <%= CGI::escapeHTML(item.title) %> + <%= item.published.strftime('%FT%T%:z ') %> + + +
+<% end %> + + +
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 @@ +<% require 'loofah' %><% require 'cgi' %> + +Planet Gentoo +<%= site.items.latest.limit(50).first.published.strftime('%FT%T%:z ') %> +Pluto + + 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>. + planet@gentoo.org + + https://planet.gentoo.org/atom.xml + + + +<% + items = site.items.latest.limit(50) + ItemCursor.new(items).each do |item, new_date, new_feed| +%> +<% if item.feed.location == "planet" %> + + <%= CGI::escapeHTML(item.url) %> + + <%= CGI::escapeHTML(item.title) %> + +
+ <% if item.summary %> + <%= CGI::escapeHTML(Loofah.fragment(item.summary).scrub!(:prune).to_s) %> + <% else %> + -/- + <% end %> +
+
+ + +
+ <% 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 %> +
+
+ + + <%= CGI::escapeHTML(item.feed.title) %> + + + <%= CGI::escapeHTML(item.feed.url) %> + + + + <%= CGI::escapeHTML(item.title) %> + <%= item.published.strftime('%FT%T%:z ') %> + + +
+<% end %> +<% end %> + + +
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 @@ + + +Planet Gentoo +https://planet.gentoo.org +en +Planet Gentoo - https://planet.gentoo.org/ +<% + require 'loofah' + require 'cgi' + items = site.items.latest.limit(50) + ItemCursor.new(items).each do |item, new_date, new_feed| +%> + + <%= CGI::escapeHTML(item.title) %> + <%= CGI::escapeHTML(item.guid) %> + <%= CGI::escapeHTML(item.url) %> + + <% 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 %> + + <%= item.published.strftime('%a, %d %b %Y %H:%M:%S %z') %> + <%= CGI::escapeHTML(item.feed.title) %> (<%= CGI::escapeHTML(item.feed.key) %>) + +<% end %> + + + + 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 @@ + + +Planet Gentoo +https://planet.gentoo.org +en +Planet Gentoo - https://planet.gentoo.org/ +<% + 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" %> + + <%= CGI::escapeHTML(item.title) %> + <%= CGI::escapeHTML(item.guid) %> + <%= CGI::escapeHTML(item.url) %> + + <% 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 %> + + <%= item.published.strftime('%a, %d %b %Y %H:%M:%S %z') %> + <%= CGI::escapeHTML(item.feed.title) %> (<%= CGI::escapeHTML(item.feed.key) %>) + +<% end %> +<% end %> + + + + 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 @@ - - + + + + diff --git a/tyrian.txt b/tyrian.txt index d2c842d..14d0175 100644 --- a/tyrian.txt +++ b/tyrian.txt @@ -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 -- cgit v1.2.3-65-gdbad