Update RSS feeds

This commit is contained in:
2024-01-27 11:01:22 +11:00
parent f194e216d0
commit f680ee8647
5 changed files with 20 additions and 6 deletions

View File

@@ -10,6 +10,18 @@ module Adamantium
published_at.strftime("%e %B, %Y") published_at.strftime("%e %B, %Y")
end end
def display_title
"🔖: #{name}"
end
def feed_content
content || ""
end
def permalink
"#{Hanami.app.settings.micropub_site_url}/bookmark/#{slug}"
end
def machine_published_at def machine_published_at
published_at.rfc2822 published_at.rfc2822
end end

View File

@@ -164,7 +164,7 @@ module Adamantium
def for_rss def for_rss
posts posts
.where(post_type: "post", location: nil) .where(post_type: ["post", "bookmark"], location: nil)
.exclude(name: nil) .exclude(name: nil)
.published .published
.combine(:tags) .combine(:tags)

View File

@@ -12,13 +12,13 @@ xml.channel do |channel|
channel.alternate_feed do |item| channel.alternate_feed do |item|
item.link "/feeds/rss" item.link "/feeds/rss"
item.title "Main feed (this feed)" item.title "Main feed (this feed)"
item.description "The main feed, with all the posts" item.description "Containing longer text posts and bookmarks"
end end
channel.alternate_feed do |item| channel.alternate_feed do |item|
item.link "/feeds/statuses_rss" item.link "/feeds/statuses_rss"
item.title "Statuses / Microblog" item.title "Statuses / Microblog"
item.description "Ony shorter posts, usually also appearing on Mastodon" item.description "Only shorter posts and photo posts, usually also appearing on Mastodon"
end end
posts.each do |post| posts.each do |post|

View File

@@ -12,13 +12,13 @@ xml.channel do |channel|
channel.alternate_feed do |item| channel.alternate_feed do |item|
item.link "/feeds/rss" item.link "/feeds/rss"
item.title "Main feed" item.title "Main feed"
item.description "The main feed, with all the posts" item.description "Containing longer text posts and bookmarks"
end end
channel.alternate_feed do |item| channel.alternate_feed do |item|
item.link "/feeds/statuses_rss" item.link "/feeds/statuses_rss"
item.title "Statuses / Microblog (this feed)" item.title "Statuses / Microblog (this feed)"
item.description "Ony shorter posts, usually also appearing on Mastodon" item.description "Only shorter posts and photo posts, usually also appearing on Mastodon"
end end
posts.each do |post| posts.each do |post|

View File

@@ -8,7 +8,9 @@ module Adamantium
expose :posts do expose :posts do
post_repo.for_rss.map do |post| post_repo.for_rss.map do |post|
Decorators::Posts::Decorator.new post post.post_type == "bookmark" ?
Decorators::Bookmarks::Decorator.new(post) :
Decorators::Posts::Decorator.new(post)
end end
end end