/forum_topics.atom: add atom feed for forum topics.

This commit is contained in:
evazion
2017-05-11 23:53:06 -05:00
parent e68946e95d
commit 8c88e87710
7 changed files with 59 additions and 3 deletions

View File

@@ -0,0 +1,16 @@
atom_feed do |feed|
feed.title("Forum Topics")
feed.updated(@forum_topics.first.try(:updated_at))
@forum_topics.each do |topic|
feed.entry(topic, published: topic.created_at, updated: topic.updated_at) do |entry|
entry.title("[#{topic.category_name}] #{topic.title}")
entry.content(format_text(topic.original_post.body), type: "html")
entry.author do |author|
author.name(topic.creator.name)
author.uri(user_url(topic.creator_id))
end
end
end
end