mirror of
https://github.com/moparisthebest/android.moparisthebest.org
synced 2024-12-23 16:08:53 -05:00
added support for excerpting feed articles, added linklog support to category feed, refactored feeds to reduce duplication
This commit is contained in:
parent
107a4af528
commit
895504f274
9
.themes/classic/source/_includes/feed_entry.xml
Normal file
9
.themes/classic/source/_includes/feed_entry.xml
Normal file
@ -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>
|
@ -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>
|
||||
|
||||
|
@ -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>
|
||||
|
@ -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 →" # "Continue reading" link text at the bottom of excerpted articles
|
||||
excerpt_in_feed: false # Truncate excerpted articles in the atom feed
|
||||
permalink_label: "∞"
|
||||
permalink_label_feed: "∞ Permalink"
|
||||
linklog_marker: "→"
|
||||
|
Loading…
Reference in New Issue
Block a user