all repos — archie @ 7735246ec0c4b1b84405efa1fa96c4748cd0165c

A minimal Hugo Theme

layouts/_default/terms.html (view raw)

 1{{ define "main" }}
 2<h1 class="page-title">All tags</h1>
 3
 4{{ $biggest := 1 }}
 5{{ $smallest := 1 }}
 6{{ $max := 3 }}
 7{{ $min := 1 }}
 8{{ $size := $min }}
 9
10{{ $data := .Data }}
11<div class="tag-cloud">
12	<ul class="tags">
13		{{ range $key, $value := .Data.Terms.ByCount }}
14		{{ $size := (add (mul (div $value.Count $biggest) (sub $max $min)) $min) }}
15		{{ $size := (cond (eq $biggest $smallest) $min $size) }}
16		<li><a style="font-size: {{ $size }}rem;" href="{{ $.Site.LanguagePrefix | absURL }}{{ $data.Plural }}/{{ $value.Name | urlize }}/">{{ $value.Name }}</a></li>
17		{{ end }}
18	</ul>
19</div>
20{{ end }}