Class: Aardi::JSONFeed
- Inherits:
-
AbstractFeed
- Object
- AbstractBlog
- AbstractFeed
- Aardi::JSONFeed
- Defined in:
- lib/aardi/json_feed.rb
Instance Attribute Summary
Attributes inherited from AbstractBlog
Instance Method Summary collapse
Methods inherited from AbstractFeed
#initialize, #render, #target_path
Methods inherited from AbstractBlog
#metadata, #mtime, #render, #title
Constructor Details
This class inherits a constructor from Aardi::AbstractFeed
Instance Method Details
#content ⇒ Object
5 6 7 8 9 10 11 |
# File 'lib/aardi/json_feed.rb', line 5 def content feed_content = { version: 'https://jsonfeed.org/version/1.1', title:, home_page_url: Config[:site_url], feed_url: } feed_content[:items] = @posts.map { |post| post_details(post) } JSON.pretty_generate(feed_content) end |