archie-shades-of-purple/layouts/_default/terms.html

21 lines
600 B
HTML
Raw Normal View History

2020-04-22 12:14:28 +02:00
{{ define "main" }}
<h1 class="page-title">All tags</h1>
2020-04-08 20:44:29 +02:00
2020-04-22 12:14:28 +02:00
{{ $biggest := 1 }}
{{ $smallest := 1 }}
{{ $max := 3 }}
{{ $min := 1 }}
{{ $size := $min }}
2020-04-08 20:44:29 +02:00
2020-04-22 12:14:28 +02:00
{{ $data := .Data }}
<div class="tag-cloud">
<ul class="tags">
2020-04-08 20:44:29 +02:00
{{ range $key, $value := .Data.Terms.ByCount }}
2020-04-22 12:14:28 +02:00
{{ $size := (add (mul (div $value.Count $biggest) (sub $max $min)) $min) }}
{{ $size := (cond (eq $biggest $smallest) $min $size) }}
<li><a style="font-size: {{ $size }}rem;" href="{{ $.Site.LanguagePrefix | absURL }}{{ $data.Plural }}/{{ $value.Name | urlize }}/">{{ $value.Name }}</a></li>
2020-04-08 20:44:29 +02:00
{{ end }}
2020-04-22 12:14:28 +02:00
</ul>
</div>
{{ end }}