Fix tag cloud highlighting first char when tags are not grouped (#1209)

* Fix tag cloud highlighting first char when tags are not grouped

* update test
This commit is contained in:
Sascha Ißbrücker
2025-10-18 07:05:15 +02:00
committed by GitHub
parent dcb15f1942
commit 70734ed273
3 changed files with 27 additions and 6 deletions

View File

@@ -15,15 +15,15 @@
{% for group in tag_cloud.groups %}
<p class="group">
{% for tag in group.tags %}
{# Highlight first char of first tag in group #}
{% if forloop.counter == 1 %}
{# Highlight first char of first tag in group if grouping is enabled #}
{% if group.highlight_first_char and forloop.counter == 1 %}
<a href="?{{ tag.query_string }}"
class="mr-2" data-is-tag-item>
<span
class="highlight-char">{{ tag.name|first_char }}</span><span>{{ tag.name|remaining_chars:1 }}</span>
</a>
{% else %}
{# Render remaining tags normally #}
{# Render tags normally #}
<a href="?{{ tag.query_string }}"
class="mr-2" data-is-tag-item>
<span>{{ tag.name }}</span>