Last active
August 29, 2015 13:59
-
-
Save staxmanade/10601886 to your computer and use it in GitHub Desktop.
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 series = '' %} | |
{% assign thisPost = nil %} | |
{% for post in site.posts %} | |
{% if post.url == page.url %} | |
{% assign series = post.series %} | |
{% assign thisPost = post %} | |
{% endif %} | |
{% endfor %} | |
{% assign count = '0' %} | |
{% assign idx = '0' %} | |
{% for post in site.posts reversed %} | |
{% if post.series == 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> of <strong>{{ count }}</strong> in a series about <strong>{{thisPost.series_about}}</strong>.</p> | |
<ul> | |
{% assign count = '0' %} | |
{% for post in site.posts reversed %} | |
{% if post.series == series %} | |
{% capture count %}{{ count | plus: '1' }}{% endcapture %} | |
<li> Part {{ count }} - | |
{% if page.url == post.url %} | |
(current) - {{post.series_title}} | |
{% elsif post.published == false %} | |
{% comment %}trying to find a way to enable this... https://github.com/jekyll/help/issues/15{% endcomment %} | |
(coming soon) {{post.series_title}} | |
{% else %} | |
<a href="{{post.url}}">{{post.series_title}}</a> | |
{% endif %} | |
</li> | |
{% endif %} | |
{% endfor %} | |
</ul> | |
</div> | |
{% assign count = nil %} | |
{% assign idx = nil %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment