Skip to content

Commit

Permalink
If a post has a description, use it in the XML data
Browse files Browse the repository at this point in the history
I noticed that the system was putting the entire post body in the description.  It is more desirable to place just the description of the post in there.  You can now add the description: yaml markup to your posts to have a more clean feed XML.  Alternatively, if you do not specify a post description, the page title will be used (instead of the post body).
  • Loading branch information
integrii committed Nov 20, 2014
1 parent 417bf67 commit 0c57133
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions feed.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,12 @@ layout: none
{% for post in site.posts limit:10 %}
<item>
<title>{{ post.title | xml_escape }}</title>
<description>{{ post.content | xml_escape }}</description>
<pubDate>{{ post.date | date: "%a, %d %b %Y %H:%M:%S %z" }}</pubDate>
{% if post.description %}
<description>{{ post.description | xml_escape }}</description>
{% else %}
<description>{{ site.description | xml_escape }}</description>
{% endif %}
<pubDate>{{ post.date | date: "%a, %d %b %Y %H:%M:%S %z" }}</pubDate>
<link>{{ site.url }}{{ post.url }}</link>
<guid isPermaLink="true">{{ site.url }}{{ post.url }}</guid>
</item>
Expand Down

0 comments on commit 0c57133

Please sign in to comment.