[Feature Request-Minor] Limit the number of tags based on tag sizze
monksy opened this issue · comments
monksy commented
May want to add a limit and configuration to the tags that are shown based on their number of usage.
Line 16 in e5ababb
{%- capture site_tags -%}
{%- for tag in site.tags -%}
{{- tag | first -}}{%- unless forloop.last -%},{%- endunless -%}
{%- endfor -%}
{%- endcapture -%}
{%- assign tags_list = site_tags | split:',' | sort -%}
{%- for tag in tags_list -%}
{%- if site.tags[tag].size >= 2 -%}
<a href="#{{- tag -}}" class="btn btn-primary tag-btn"><i class="fas fa-tag" aria-hidden="true"></i> {{- tag -}} ({{site.tags[tag].size}})</a>
{%- endif -%}
{%- endfor -%}
<div id="full-tags-list">
{%- for tag in tags_list -%}
{%- if site.tags[tag].size >= 2 -%}
<h2 id="{{- tag -}}" class="linked-section">
<i class="fas fa-tag" aria-hidden="true"></i>
{{- tag -}} ({{site.tags[tag].size}})
</h2>
<div class="post-list">
{%- for post in site.tags[tag] -%}
<div class="tag-entry">
<a href="{{ post.url | relative_url }}">{{- post.title | strip_html -}}</a>
<div class="entry-date">
<time datetime="{{- post.date | date_to_xmlschema -}}">{{- post.date | date: date_format -}}</time>
</div>
</div>
{%- endfor -%}
</div>
{%- endif -%}
{%- endfor -%}
</div>
monksy commented
You can't exclude the full links at the bottom because it breaks the links from the posts.