posts.html 1.1 KB

12345678910111213141516171819202122232425262728293031
  1. ---
  2. layout: archive
  3. ---
  4. {{ content }}
  5. <ul class="taxonomy__index">
  6. {% assign postsInYear = site.posts | where_exp: "item", "item.hidden != true" | group_by_exp: 'post', 'post.date | date: "%Y"' %}
  7. {% for year in postsInYear %}
  8. <li>
  9. <a href="#{{ year.name }}">
  10. <strong>{{ year.name }}</strong> <span class="taxonomy__count">{{ year.items | size }}</span>
  11. </a>
  12. </li>
  13. {% endfor %}
  14. </ul>
  15. {% assign entries_layout = page.entries_layout | default: 'list' %}
  16. {% assign postsByYear = site.posts | where_exp: "item", "item.hidden != true" | group_by_exp: 'post', 'post.date | date: "%Y"' %}
  17. {% for year in postsByYear %}
  18. <section id="{{ year.name }}" class="taxonomy__section">
  19. <h2 class="archive__subtitle">{{ year.name }}</h2>
  20. <div class="entries-{{ entries_layout }}">
  21. {% for post in year.items %}
  22. {% include archive-single.html type=entries_layout %}
  23. {% endfor %}
  24. </div>
  25. <a href="#page-title" class="back-to-top">{{ site.data.ui-text[site.locale].back_to_top | default: 'Back to Top' }} &uarr;</a>
  26. </section>
  27. {% endfor %}