Update RSS feeds
This commit is contained in:
@@ -10,6 +10,18 @@ module Adamantium
|
||||
published_at.strftime("%e %B, %Y")
|
||||
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
|
||||
published_at.rfc2822
|
||||
end
|
||||
|
@@ -164,7 +164,7 @@ module Adamantium
|
||||
|
||||
def for_rss
|
||||
posts
|
||||
.where(post_type: "post", location: nil)
|
||||
.where(post_type: ["post", "bookmark"], location: nil)
|
||||
.exclude(name: nil)
|
||||
.published
|
||||
.combine(:tags)
|
||||
|
@@ -12,13 +12,13 @@ xml.channel do |channel|
|
||||
channel.alternate_feed do |item|
|
||||
item.link "/feeds/rss"
|
||||
item.title "Main feed (this feed)"
|
||||
item.description "The main feed, with all the posts"
|
||||
item.description "Containing longer text posts and bookmarks"
|
||||
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"
|
||||
item.description "Only shorter posts and photo posts, usually also appearing on Mastodon"
|
||||
end
|
||||
|
||||
posts.each do |post|
|
||||
|
@@ -12,13 +12,13 @@ xml.channel do |channel|
|
||||
channel.alternate_feed do |item|
|
||||
item.link "/feeds/rss"
|
||||
item.title "Main feed"
|
||||
item.description "The main feed, with all the posts"
|
||||
item.description "Containing longer text posts and bookmarks"
|
||||
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"
|
||||
item.description "Only shorter posts and photo posts, usually also appearing on Mastodon"
|
||||
end
|
||||
|
||||
posts.each do |post|
|
||||
|
@@ -8,7 +8,9 @@ module Adamantium
|
||||
|
||||
expose :posts do
|
||||
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
|
||||
|
||||
|
Reference in New Issue
Block a user