hugo-theme-even/layouts/_default/terms.html

45 lines
1.5 KiB
HTML
Raw Normal View History

2017-08-28 09:03:07 +00:00
{{ define "title" }}{{ index .Site.Data.even.default .Data.Plural }} - {{ .Site.Title }}{{ end }}
2017-08-27 14:38:42 +00:00
{{ define "content" }}
{{ $lang := .Site.Data.even.default -}}
{{ $name := .Data.Plural -}}
{{ $terms := .Data.Terms.ByCount -}}
{{ $length := len $terms -}}
{{ if eq $name "categories" }}
<div class="categories">
<div class="categories-title">
{{ if eq $length 0 }}
{{ $lang.counter.categories.zero }}
{{ else }}
{{ printf $lang.counter.categories.other $length }}
{{ end }}
</div>
<div class="categories-tags">
{{ range $key, $value := $terms }}
2017-08-30 16:18:22 +00:00
<a class="category-link" href="{{ $name | urlize | relURL }}/{{ $value.Term | urlize }}/">
2017-08-27 14:38:42 +00:00
{{ $value.Term }}
<span class="category-count">{{ len $value.Pages }}</span>
</a>
{{ end }}
</div>
</div>
{{ else if eq $name "tags" }}
<div class="tag-cloud">
<div class="tag-cloud-title">
{{ if eq $length 0 }}
{{ $lang.counter.tagcloud.zero }}
{{ else }}
{{ printf $lang.counter.tagcloud.other $length}}
{{ end }}
</div>
<div class="tag-cloud-tags">
{{ range $key, $value := $terms }}
2017-08-30 16:18:22 +00:00
<a href="{{ $name | urlize | relURL }}/{{ $value.Term | urlize }}/">
2017-08-27 14:38:42 +00:00
{{ $value.Term }}
<span class="tag-count">{{ len $value.Pages }}</span>
</a>
{{ end }}
</div>
</div>
{{ end }}
{{ end }}