Add feature to show full post content in RSS feeds

This commit is contained in:
Mikko Ahlroth 2015-09-13 20:03:08 +03:00
parent 4e8ac4624b
commit 450dacb92e
3 changed files with 10 additions and 1 deletions

View file

@ -19,6 +19,7 @@ config :blog_config,
blog_author: "Author McAuthor",
absolute_url: "http://localhost:4000", # Absolute URL to the site without trailing slash, including protocol
enable_feeds: false, # Set to true to enable RSS feeds
feeds_full_content: false, # Show full content in feeds instead of short content
posts_per_page: 10,
posts_in_feed: 20,

View file

@ -28,7 +28,11 @@
<description>
<![CDATA[
<%= post.short_content %>
<%= if show_full do %>
<%= post.content %>
<% else %>
<%= post.short_content %>
<% end %>
<a href="<%= @absolute_url %><%= page_path @conn, :post, year, j_month, j_day, post.slug %>">
Read more

View file

@ -1,3 +1,7 @@
defmodule MebeWeb.FeedView do
use MebeWeb.Web, :view
@feeds_full_content Application.get_env(:blog_config, :feeds_full_content)
def show_full(), do: @feeds_full_content
end