-
Notifications
You must be signed in to change notification settings - Fork 28
Expand file tree
/
Copy pathlist.html
More file actions
41 lines (41 loc) · 1.71 KB
/
list.html
File metadata and controls
41 lines (41 loc) · 1.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<section class="section content-padding">
<div class="tag-cloud is-hidden-mobile">
<h2 class="tag-cloud-title">{{ i18n "tags" }}</h2>
{{ if not (eq (len $.Site.Taxonomies.tags) 0) }}
{{ $fontUnit := "rem" }}
{{ $largestFontSize := 2.5 }}
{{ $smallestFontSize := 1.0 }}
{{ $fontSpread := sub $largestFontSize $smallestFontSize }}
{{ $max := add (len (index $.Site.Taxonomies.tags.ByCount 0).Pages) 1 }}
{{ $min := len (index $.Site.Taxonomies.tags.ByCount.Reverse 0).Pages }}
{{ $spread := sub $max $min }}
{{ $fontStep := div $fontSpread $spread }}
<ul class="tag-cloud-item">
{{ range $name, $taxonomy := $.Site.Taxonomies.tags }}
{{ $currentTagCount := len $taxonomy.Pages }}
{{ $currentFontSize := (add $smallestFontSize (mul (sub $currentTagCount $min) $fontStep) ) }}
{{ $count := len $taxonomy.Pages }}
{{ $weight := div (sub (math.Log $count) (math.Log $min)) (sub (math.Log $max) (math.Log $min)) }}
{{ $currentFontSize := (add $smallestFontSize (mul (sub $largestFontSize $smallestFontSize) $weight) ) }}
<li>
<a href="{{ "/tags/" | relLangURL }}{{ $name | urlize }}"
style="font-size:{{$currentFontSize}}{{$fontUnit}}"
>
{{ $name }}
</a>
</li>
{{ end }}
</ul>
{{ end }}
</div>
{{ with partial "_decorators/content-container.html" . }}
{{ if .Content }}
{{ .Content }}
{{ end }}
{{ $posts := .RegularPagesRecursive.ByPublishDate.Reverse }}
{{ partial "posts/list-without-summary.html" $posts }}
{{ end }}
{{ if .Content }}
{{ partial "shortcuts.html" . }}
{{ end }}
</section>