✨ feat: allow sorting tags based on post count (#344)
Co-authored-by: welpo <welpo@users.noreply.github.com>
This commit is contained in:
@@ -7,6 +7,11 @@
|
||||
{{ macros_page_header::page_header(title=title)}}
|
||||
|
||||
{% set tag_count = terms | length %}
|
||||
{% if config.extra.tag_sorting == "frequency" %}
|
||||
{% set terms = terms | sort(attribute="pages") | reverse %}
|
||||
{% elif config.extra.tag_sorting != "name" %}
|
||||
{{ throw (message="Invalid tag_sorting option: " ~ config.extra.tag_sorting ~ ". Valid options are 'name' and 'frequency'.") }}
|
||||
{% endif %}
|
||||
<div id="tag-cloud" class="{% if tag_count > 16 %}three-columns{% elif tag_count > 8 %}two-columns{% endif %}">
|
||||
<ul class="tags">
|
||||
{%- for term in terms -%}
|
||||
|
@@ -7,6 +7,11 @@
|
||||
{{ macros_page_header::page_header(title=title)}}
|
||||
|
||||
{% set tag_count = terms | length %}
|
||||
{% if config.extra.tag_sorting == "frequency" %}
|
||||
{% set terms = terms | sort(attribute="pages") | reverse %}
|
||||
{% elif config.extra.tag_sorting != "name" %}
|
||||
{{ throw (message="Invalid tag_sorting option: " ~ config.extra.tag_sorting ~ ". Valid options are 'name' and 'frequency'.") }}
|
||||
{% endif %}
|
||||
<div id="tag-cloud" class="{% if tag_count > 16 %}three-columns{% elif tag_count > 8 %}two-columns{% endif %}">
|
||||
<ul class="tags">
|
||||
{%- for term in terms -%}
|
||||
|
Reference in New Issue
Block a user