Browse Source

Imported fix from blog.

gh-pages
Franco Masotti 3 years ago
parent
commit
db334f1bc2
Signed by: frnmst
GPG Key ID: 24116ED85666780A
  1. 22
      _pages/index.md

22
_pages/index.md

@ -6,13 +6,18 @@ excerpt: none
<div class="index" markdown="1">
{% for post in site.posts %}
{% capture year %}{{ post.date | date: '%Y' }}{% endcapture %}
{% capture nyear %}{{ post.next.date | date: '%Y' }}{% endcapture %}
{% if year != nyear %}
### Year {{ year }}
<ul class="post-list">
{% endif %}
{% unless post.next %}
### Year {{ post.date | date: '%Y' }}
{% else %}
{% capture year %}{{ post.date | date: '%Y' }}{% endcapture %}
{% capture nyear %}{{ post.next.date | date: '%Y' }}{% endcapture %}
{% if year != nyear %}
### Year {{ post.date | date: '%Y' }}
{% endif %}
{% endunless %}
<div markdown="0">
{% comment %}Start list here instead after "Year" to simplify liquid code. This works nonetheless.{%endcomment %}
<ul class="post-list">
<li>
<a href="{{ post.url | prepend: site.baseurl }}.html">
<span class="post-list-metadata">
@ -31,10 +36,7 @@ excerpt: none
</span>
</a>
</li>
</div>
{% capture pyear %}{{ post.previous.date | date: '%Y' }}{% endcapture %}
{% if year != pyear %}
</ul>
{% endif %}
</div>
{% endfor %}
</div>