tag cloud con font size variabile e soglia minima #247

Merged
paspo merged 3 commits from paspo/bglug.it:taglist_advanced into main 2024-09-23 20:09:40 +00:00
3 changed files with 7 additions and 5 deletions
Showing only changes of commit 4abcf3c2ef - Show all commits

View File

@ -9,3 +9,4 @@ subscribe_mailinglist: Subscribe to our mailing list
subscribe: Subscribe
come_and_see_us: Come and see us
where: Where
more_tags: "...more"

View File

@ -9,3 +9,4 @@ subscribe_mailinglist: Iscriviti alla mailing list
subscribe: Iscriviti
come_and_see_us: Vieni a trovarci
where: Dove siamo
more_tags: "...altro"

View File

@ -49,13 +49,13 @@
{{ $c := len .Pages }}
{{ $font_size := (add $font_min (mul $c $font_step)) }}
{{ if ge $c $count_min_display }}
<li style="font-size: {{ $font_size }}rem;">
<a href="/{{ .Page.Lang }}{{ .Page.Path }}">{{ .Page.LinkTitle | safeHTML }}</a><sup>{{ len .Pages }}</sup></li>
<li>
<a style="font-size: {{ $font_size }}rem;" href="/{{ .Page.Lang }}{{ .Page.Path }}">{{ .Page.LinkTitle | safeHTML }} ({{ len .Pages }})</a></li>
{{ else }}
<li style="font-size: {{ $font_size }}rem; display: none;">
<a href="/{{ .Page.Lang }}{{ .Page.Path }}">{{ .Page.LinkTitle | safeHTML }}</a><sup>{{ len .Pages }}</sup></li>
<li style="display: none;">
<a style="font-size: {{ $font_size }}rem;" href="/{{ .Page.Lang }}{{ .Page.Path }}">{{ .Page.LinkTitle | safeHTML }} ({{ len .Pages }})</a></li>
{{ end }}
{{ end }}
<li><a href="#" onclick="return show_all_tags(this)">...</a></li>
<li><a href="#" onclick="return show_all_tags(this)">{{ T "more_tags" }}</a></li>
</ul>
</section>