themu/layouts/_default/terms.html

21 lines
600 B
HTML
Raw Normal View History

2020-04-22 13:14:28 +03:00
{{ define "main" }}
2023-07-31 20:33:38 +03:00
<h1 class="page-title">теги</h1>
2020-04-08 21:44:29 +03:00
2020-04-22 13:14:28 +03:00
{{ $biggest := 1 }}
{{ $smallest := 1 }}
{{ $max := 3 }}
{{ $min := 1 }}
{{ $size := $min }}
2020-04-08 21:44:29 +03:00
2020-04-22 13:14:28 +03:00
{{ $data := .Data }}
<div class="tag-cloud">
<ul class="tags">
2020-04-08 21:44:29 +03:00
{{ range $key, $value := .Data.Terms.ByCount }}
2020-04-22 13:14:28 +03: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 21:44:29 +03:00
{{ end }}
2020-04-22 13:14:28 +03:00
</ul>
</div>
{{ end }}