all repos — archie @ ac7b05d2a110b10adac9cf20bd1030f7bd303cfd

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 class="post"><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 }}