validate setting

This commit is contained in:
welpo 2024-06-29 17:33:24 +02:00
parent c685b95f9e
commit 1cfce23457
No known key found for this signature in database
GPG key ID: A2F978CF4EC1F5A6

View file

@ -9,6 +9,8 @@
{% 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">