From f194e216d06402b6cd4adc6f4f1ac9057205dee1 Mon Sep 17 00:00:00 2001 From: Daniel Nitsikopoulos Date: Fri, 26 Jan 2024 23:05:04 +1100 Subject: [PATCH] List alternate feeds on RSS page --- app/templates/feeds/rss.xml.builder | 12 ++++++++++++ app/templates/feeds/statuses_rss.xml.builder | 12 ++++++++++++ public/assets/style.xslt | 14 ++++++++++++++ 3 files changed, 38 insertions(+) diff --git a/app/templates/feeds/rss.xml.builder b/app/templates/feeds/rss.xml.builder index 106f275..2753a16 100644 --- a/app/templates/feeds/rss.xml.builder +++ b/app/templates/feeds/rss.xml.builder @@ -9,6 +9,18 @@ xml.channel do |channel| channel.pubDate Time.now.rfc2822 channel.ttl 1800 + channel.alternate_feed do |item| + item.link "/feeds/rss" + item.title "Main feed (this feed)" + item.description "The main feed, with all the posts" + end + + channel.alternate_feed do |item| + item.link "/feeds/statuses_rss" + item.title "Statuses / Microblog" + item.description "Ony shorter posts, usually also appearing on Mastodon" + end + posts.each do |post| channel.item do |item| item.title post.display_title diff --git a/app/templates/feeds/statuses_rss.xml.builder b/app/templates/feeds/statuses_rss.xml.builder index cf1c58f..9dee418 100644 --- a/app/templates/feeds/statuses_rss.xml.builder +++ b/app/templates/feeds/statuses_rss.xml.builder @@ -9,6 +9,18 @@ xml.channel do |channel| channel.pubDate Time.now.rfc2822 channel.ttl 1800 + channel.alternate_feed do |item| + item.link "/feeds/rss" + item.title "Main feed" + item.description "The main feed, with all the posts" + end + + channel.alternate_feed do |item| + item.link "/feeds/statuses_rss" + item.title "Statuses / Microblog (this feed)" + item.description "Ony shorter posts, usually also appearing on Mastodon" + end + posts.each do |post| channel.item do |item| item.title post.raw_content diff --git a/public/assets/style.xslt b/public/assets/style.xslt index 436e196..99b07d2 100644 --- a/public/assets/style.xslt +++ b/public/assets/style.xslt @@ -30,6 +30,20 @@ Visit Website → + +

Alternate feeds

+ + + +

Recent Items