File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11< section class ="section content-padding flex-row ">
2+ < div class ="tag-cloud is-hidden-mobile ">
3+ < h2 class ="tag-cloud-title "> {{ i18n "tags" }}</ h2 >
4+ {{ if not (eq (len $.Site.Taxonomies.tags) 0) }}
5+ {{ $fontUnit := "rem" }}
6+ {{ $largestFontSize := 2.5 }}
7+ {{ $smallestFontSize := 1.0 }}
8+ {{ $fontSpread := sub $largestFontSize $smallestFontSize }}
9+ {{ $max := add (len (index $.Site.Taxonomies.tags.ByCount 0).Pages) 1 }}
10+ {{ $min := len (index $.Site.Taxonomies.tags.ByCount.Reverse 0).Pages }}
11+ {{ $spread := sub $max $min }}
12+ {{ $fontStep := div $fontSpread $spread }}
13+ < ul class ="tag-cloud-item ">
14+ {{ range $name, $taxonomy := $.Site.Taxonomies.tags }}
15+ {{ $currentTagCount := len $taxonomy.Pages }}
16+ {{ $currentFontSize := (add $smallestFontSize (mul (sub $currentTagCount $min) $fontStep) ) }}
17+ {{ $count := len $taxonomy.Pages }}
18+ {{ $weight := div (sub (math.Log $count) (math.Log $min)) (sub (math.Log $max) (math.Log $min)) }}
19+ {{ $currentFontSize := (add $smallestFontSize (mul (sub $largestFontSize $smallestFontSize) $weight) ) }}
20+ < li >
21+ < a href ="{{ "/tags/" | relLangURL }}{{ $name | urlize }}"
22+ style="font-size:{{$currentFontSize}}{{$fontUnit}}"
23+ >
24+ {{ $name }}
25+ </ a >
26+ </ li >
27+ {{ end }}
28+ </ ul >
29+ {{ end }}
30+ </ div >
231 < div class ="content-container ">
332 {{ partial "breadcrumbs.html" . }}
433 < h1 > {{ .Title }}</ h1 >
You can’t perform that action at this time.
0 commit comments