Skip to content

Commit

Permalink
remove hidden posts from listings
Browse files Browse the repository at this point in the history
  • Loading branch information
amkartashov committed Jul 27, 2020
1 parent 2db400c commit 623c179
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions _layouts/posts.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
layout: archive
---

{{ content }}

<ul class="taxonomy__index">
{% assign postsInYear = site.posts | where_exp:"item", "item.hidden != true" | group_by_exp: 'post', 'post.date | date: "%Y"' %}
{% for year in postsInYear %}
<li>
<a href="#{{ year.name }}">
<strong>{{ year.name }}</strong> <span class="taxonomy__count">{{ year.items | size }}</span>
</a>
</li>
{% endfor %}
</ul>

{% assign postsByYear = site.posts | where_exp:"item", "item.hidden != true" | group_by_exp: 'post', 'post.date | date: "%Y"' %}
{% for year in postsByYear %}
<section id="{{ year.name }}" class="taxonomy__section">
<h2 class="archive__subtitle">{{ year.name }}</h2>
<div class="entries-{{ page.entries_layout | default: 'list' }}">
{% for post in year.items %}
{% include archive-single.html type=page.entries_layout %}
{% endfor %}
</div>
<a href="#page-title" class="back-to-top">{{ site.data.ui-text[site.locale].back_to_top | default: 'Back to Top' }} &uarr;</a>
</section>
{% endfor %}

0 comments on commit 623c179

Please sign in to comment.