mirror of
https://github.com/MinimalBible/MinimalBible.github.io
synced 2024-12-21 06:08:19 -05:00
Group all posts by year
This commit is contained in:
parent
31b07c1f55
commit
d0bf3106c8
34
posts.html
34
posts.html
@ -6,17 +6,27 @@ description: "An archive of posts."
|
||||
---
|
||||
|
||||
{% for post in site.posts %}
|
||||
<article class="hentry">
|
||||
<header>
|
||||
<div class="entry-meta"><span class="entry-date date published"><time datetime="{{ post.date | date_to_xmlschema }}"><a href="{{ site.url }}{{ post.url }}">{{ post.date | date: "%B %d, %Y" }}</a></time></span><span class="author vcard fn"><a class="url fn" href="{{ site.url }}">{{ site.owner.name }}</a></span>{% if site.disqus_shortname and post.comments %} • <span class="entry-comments"><a href="{{ site.url }}{{ post.url }}#disqus_thread">Comment</a></span>{% endif %}</div><!-- /.entry-meta -->
|
||||
{% if post.link %}
|
||||
<h1 class="entry-title"><a href="{{ site.url }}{{ post.url }}" rel="bookmark" title="{{ post.title }}"><i class="icon-double-angle-right"></i></a> <a href="{{ post.link }}">{{ post.title }}</a></h1>
|
||||
{% else %}
|
||||
<h1 class="entry-title"><a href="{{ site.url }}{{ post.url }}" rel="bookmark" title="{{ post.title }}">{{ post.title }}</a></h1>
|
||||
{% capture this_year %}{{ post.date | date: "%Y" }}{% endcapture %}
|
||||
{% capture next_year %}{{ post.previous.date | date: "%Y" }}{% endcapture %}
|
||||
|
||||
{% if forloop.first %}
|
||||
<article>
|
||||
<h2 id="{{ this_year }}-ref">{{ this_year }}</h2>
|
||||
<ul>
|
||||
{% endif %}
|
||||
|
||||
<li class="entry-title"><a href="{{ site.url }}{{ post.url }}" title="{{ post.title }}">{{ post.title }}</a></li>
|
||||
|
||||
{% if forloop.last %}
|
||||
</ul>
|
||||
</article>
|
||||
{% else %}
|
||||
{% if this_year != next_year %}
|
||||
</ul>
|
||||
</article>
|
||||
<article>
|
||||
<h2 id="{{ next_year }}-ref">{{next_year}}</h2>
|
||||
<ul>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</header>
|
||||
<div class="entry-content">
|
||||
<p>{% if post.description %}{{ post.description }}{% else %}{{ post.content | strip_html | strip_newlines | truncate: 120 }}{% endif %} <a href="{{ site.url }}{{ post.url }}">Continue reading</a></p>
|
||||
</div><!-- /.entry-content -->
|
||||
</article><!-- /.hentry -->
|
||||
{% endfor %}
|
Loading…
Reference in New Issue
Block a user