Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

added support for excerpting feed articles, added linklog support to …

…category feed, refactored feeds to reduce duplication
  • Loading branch information...
commit 895504f274b871f779da2ae232ac846ba8c3779a 1 parent 107a4af
Brandon Mathis authored
9 .themes/classic/source/_includes/feed_entry.xml
View
@@ -0,0 +1,9 @@
+{% assign linklog = false %}
+{% if post.external-url %}{% capture linklog %}{{ post.external-url }}{% endcapture %}{% endif %}
+{% capture title_url %}{% if linklog %}{{ linklog }}{% else %}{{ site.url }}{{ post.url }}{% endif %}{% endcapture %}
+{% capture title %}{% if linklog and site.linklog_marker_position_feed == 'before' %}{% unless linklog %}{{ site.standard_post_marker }}{% endunless %}{{ site.linklog_marker }} {% endif %}{{ post.title }}{% if linklog and site.linklog_marker_position_feed == 'after' %} {{ site.linklog_marker }}{% endif %}{% endcapture %}
+{% capture content %}{% if site.excerpt_in_feed %}{{ post.content | excerpt | expand_urls: site.url }}<p><a rel="bookmark" href="{{ site.url }}{{ post.url }}">{{ site.excerpt_link }}</a></p>{% else %}{{ post.content | expand_urls: site.url }}<p><a rel="bookmark" href="{{ site.url }}{{ post.url }}">{{ site.permalink_label_feed }}</a></p>{% endif %}{% endcapture %}
+<title type="html"><![CDATA[{{ title | cdata_escape }}]]></title>
+<link href="{{ title_url }}"/>
+<updated>{{ post.date | date_to_xmlschema }}</updated>
+<id>{{ site.url }}{{ post.id }}</id>
12 .themes/classic/source/_layouts/category_feed.xml
View
@@ -16,12 +16,10 @@ layout: nil
<generator uri="http://octopress.org/">Octopress</generator>
{% for post in site.categories[page.category] limit: 5 %}
- <entry>
- <title type="html"><![CDATA[{{ post.title | cdata_escape }}]]></title>
- <link href="{{ site.url }}{{ post.url }}"/>
- <updated>{{ post.date | date_to_xmlschema }}</updated>
- <id>{{ site.url }}{{ post.id }}</id>
- <content type="html"><![CDATA[{{ post.content | expand_urls: site.url | markdownify | cdata_escape }}]]></content>
- </entry>
+ <entry>
+ {% include feed_entry.xml %}
+ <content type="html"><![CDATA[{{ content | markdownify | cdata_escape }}]]></content>
+ </entry>
{% endfor %}
</feed>
+
16 .themes/classic/source/atom.xml
View
@@ -15,17 +15,9 @@ layout: nil
<generator uri="http://octopress.org/">Octopress</generator>
{% for post in site.posts limit: 20 %}
- {% assign linklog = false %}
- {% if post.external-url %}{% capture linklog %}{{ post.external-url }}{% endcapture %}{% endif %}
- {% capture title_url %}{% if linklog %}{{ linklog }}{% else %}{{ site.url }}{{ post.url }}{% endif %}{% endcapture %}
- {% capture title %}{% if linklog and site.linklog_marker_position_feed == 'before' %}{% unless linklog %}{{ site.standard_post_marker }}{% endunless %}{{ site.linklog_marker }} {% endif %}{{ post.title }}{% if linklog and site.linklog_marker_position_feed == 'after' %} {{ site.linklog_marker }}{% endif %}{% endcapture %}
- <entry>
- <title type="html"><![CDATA[{{ title | cdata_escape }}]]></title>
- <link href="{{ title_url }}"/>
- <updated>{{ post.date | date_to_xmlschema }}</updated>
- <id>{{ site.url }}{{ post.id }}</id>
- {% capture content %}{{ post.content | expand_urls: site.url | cdata_escape }}<p><a rel="bookmark" href="{{ site.url }}{{ post.url }}">{{ site.permalink_label_feed }}</a></p>{% endcapture %}
- <content type="html"><![CDATA[{{ content }}]]></content>
- </entry>
+ <entry>
+ {% include feed_entry.xml %}
+ <content type="html"><![CDATA[{{ content | cdata_escape }}]]></content>
+ </entry>
{% endfor %}
</feed>
1  _config.yml
View
@@ -40,6 +40,7 @@ paginate: 10 # Posts per page on the blog index
pagination_dir: blog # Directory base for pagination URLs eg. /blog/page/2/
recent_posts: 5 # Posts in the sidebar Recent Posts section
excerpt_link: "Read on &rarr;" # "Continue reading" link text at the bottom of excerpted articles
+excerpt_in_feed: false # Truncate excerpted articles in the atom feed
permalink_label: "&infin;"
permalink_label_feed: "&infin; Permalink"
linklog_marker: "&rarr;"

1 comment on commit 895504f

Dmitry Khraponov

Category feed shows textile text without convert it to html. Example http://snupt.com/categories/linklog/ (see img lines)

Please sign in to comment.
Something went wrong with that request. Please try again.