Merge categories
and tags
layout into _includes/posts-taxonomy.html
This commit is contained in:
37
_includes/posts-taxonomy.html
Normal file
37
_includes/posts-taxonomy.html
Normal file
@ -0,0 +1,37 @@
|
||||
{% assign items_max = 0 %}
|
||||
{% for item in include.taxonomies %}
|
||||
{% if item[1].size > items_max %}
|
||||
{% assign items_max = item[1].size %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
<ul class="taxonomy__index">
|
||||
{% for i in (1..items_max) reversed %}
|
||||
{% for item in include.taxonomies %}
|
||||
{% if item[1].size == i %}
|
||||
<li>
|
||||
<a href="#{{ item[0] | slugify }}">
|
||||
<strong>{{ item[0] }}</strong> <span class="taxonomy__count">{{ i }}</span>
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
||||
{% assign entries_layout = page.entries_layout | default: 'list' %}
|
||||
{% for i in (1..items_max) reversed %}
|
||||
{% for taxonomy in include.taxonomies %}
|
||||
{% if taxonomy[1].size == i %}
|
||||
<section id="{{ taxonomy[0] | slugify }}" class="taxonomy__section">
|
||||
<h2 class="archive__subtitle">{{ taxonomy[0] }}</h2>
|
||||
<div class="entries-{{ entries_layout }}">
|
||||
{% for post in taxonomy.last %}
|
||||
{% include archive-single.html type=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' }} ↑</a>
|
||||
</section>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endfor %}
|
Reference in New Issue
Block a user