Created
November 27, 2013 03:30
-
-
Save budparr/7670277 to your computer and use it in GitHub Desktop.
copy of realjenius bit of non-plugin liquid code to generate a series of posts
https://github.com/realjenius/site-samples/blob/master/2012-11-03-jekyll-series-list/series.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% assign count = '0' %} | |
{% assign idx = '0' %} | |
{% for post in site.posts reversed %} | |
{% if post.series == page.series %} | |
{% capture count %}{{ count | plus: '1' }}{% endcapture %} | |
{% if post.url == page.url %} | |
{% capture idx %}{{count}}{% endcapture %} | |
{% endif %} | |
{% endif %} | |
{% endfor %} | |
<div class="seriesNote"> | |
<p>This article is <strong>Part {{ idx }}</strong> in a <strong>{{ count }}-Part</strong> Series: "{{ page.series}}"</p> | |
<ul> | |
{% assign count = '0' %} | |
{% for post in site.posts reversed %} | |
{% if post.series == page.series %} | |
{% capture count %}{{ count | plus: '1' }}{% endcapture %} | |
<li>Part {{ count }} - | |
{% if page.url == post.url %} | |
This Article | |
{% else %} | |
<a href="{{post.url}}">{{post.title}}</a> | |
{% endif %} | |
</li> | |
{% endif %} | |
{% endfor %} | |
</ul> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment