diff --git a/app/decorators/bookmarks/decorator.rb b/app/decorators/bookmarks/decorator.rb index 92353f8..acd7039 100644 --- a/app/decorators/bookmarks/decorator.rb +++ b/app/decorators/bookmarks/decorator.rb @@ -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 diff --git a/app/repos/post_repo.rb b/app/repos/post_repo.rb index 1401bc8..6f41adf 100644 --- a/app/repos/post_repo.rb +++ b/app/repos/post_repo.rb @@ -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) diff --git a/app/templates/feeds/rss.xml.builder b/app/templates/feeds/rss.xml.builder index 2753a16..e9d24d6 100644 --- a/app/templates/feeds/rss.xml.builder +++ b/app/templates/feeds/rss.xml.builder @@ -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| diff --git a/app/templates/feeds/statuses_rss.xml.builder b/app/templates/feeds/statuses_rss.xml.builder index 9dee418..505cb96 100644 --- a/app/templates/feeds/statuses_rss.xml.builder +++ b/app/templates/feeds/statuses_rss.xml.builder @@ -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| diff --git a/app/views/feeds/rss.rb b/app/views/feeds/rss.rb index da5cb47..776ebdd 100644 --- a/app/views/feeds/rss.rb +++ b/app/views/feeds/rss.rb @@ -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