Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
37 lines (33 sloc) 1.14 KB
---
layout: default
---
{% capture page_subtitle %}Articles by tag{% endcapture %}
{% include title_header.html title=page.name subtitle=page_subtitle %}
<div class="text-justify">
{% if site.tags[page.slug] %}
{% for post in site.tags[page.slug] %}
{% capture post_year %}{{ post.date | date: '%Y' }}{% endcapture %}
{% if forloop.first %}
<h3 class="m-t-3 m-b-1">{{ post_year }}</h3>
<div class="list-group">
{% endif %}
{% unless forloop.first %}
{% assign previous_index = forloop.index0 | minus: 1 %}
{% capture previous_post_year %}{{ site.tags[page.slug][previous_index].date | date: '%Y' }}{% endcapture %}
{% if post_year != previous_post_year %}
</div>
<h3 class="m-t-3 m-b-1">{{ post_year }}</h3>
<div class="list-group">
{% endif %}
{% endunless %}
<a href="{{ post.url }}" class="list-group-item">
<h4 class="list-group-item-heading h6">{{ post.title }}</h4>
</a>
{% if forloop.last %}
</div>
{% endif %}
{% endfor %}
{% else %}
<p>There are no posts in this tag.</p>
{% endif %}
</div>