Update RSS feeds
This commit is contained in:
@@ -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
|
||||||
|
@@ -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)
|
||||||
|
@@ -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|
|
||||||
|
@@ -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|
|
||||||
|
@@ -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
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user