tag cloud con font size variabile e soglia minima #247
@ -1,4 +1,13 @@
|
|||||||
<section>
|
<section>
|
||||||
|
<script>
|
||||||
|
function show_all_tags(e) {
|
||||||
|
$(".tags-sidebar li").css("display","inline-block");
|
||||||
|
$(e).css("display","none");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
{{- $hiddenTags := slice "Linuxday-Featured" -}}
|
{{- $hiddenTags := slice "Linuxday-Featured" -}}
|
||||||
<h3>Tags</h3>
|
<h3>Tags</h3>
|
||||||
<ul class="tags-sidebar">
|
<ul class="tags-sidebar">
|
||||||
@ -38,11 +47,15 @@
|
|||||||
{{/* range $tags.ByCount */}}
|
{{/* range $tags.ByCount */}}
|
||||||
{{ range $tags.Alphabetical }}
|
{{ range $tags.Alphabetical }}
|
||||||
{{ $c := len .Pages }}
|
{{ $c := len .Pages }}
|
||||||
|
{{ $font_size := (add $font_min (mul $c $font_step)) }}
|
||||||
{{ if ge $c $count_min_display }}
|
{{ if ge $c $count_min_display }}
|
||||||
{{ $font_size := (add $font_min (mul $c $font_step)) }}
|
|
||||||
<li style="font-size: {{ $font_size }}rem;">
|
<li style="font-size: {{ $font_size }}rem;">
|
||||||
<a href="/{{ .Page.Lang }}{{ .Page.Path }}">{{ .Page.LinkTitle | safeHTML }}</a><sup>{{ len .Pages }}</sup></li>
|
<a href="/{{ .Page.Lang }}{{ .Page.Path }}">{{ .Page.LinkTitle | safeHTML }}</a><sup>{{ len .Pages }}</sup></li>
|
||||||
{{ end }}
|
{{ 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>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
{{ end }}
|
||||||
|
<li><a href="#" onclick="return show_all_tags(this)">...</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</section>
|
</section>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user