mirror of
https://git.adityakumar.xyz/hugo-theme-even.git
synced 2024-11-08 14:39:44 +00:00
f14d7b5f73
Closes #89
44 lines
1.4 KiB
HTML
44 lines
1.4 KiB
HTML
{{- define "title" }}{{ T .Data.Plural }} - {{ .Site.Title }}{{ end -}}
|
|
|
|
{{- define "content" -}}
|
|
{{ $name := .Data.Plural -}}
|
|
{{ $terms := .Data.Terms.ByCount -}}
|
|
{{ $length := len $terms -}}
|
|
{{ if eq $name "categories" -}}
|
|
<div class="terms">
|
|
<div class="terms-title">
|
|
{{ if eq $length 0 -}}
|
|
{{ T "zeroCategoryCounter" }}
|
|
{{- else -}}
|
|
{{ T "categoryCounter" $length }}
|
|
{{- end }}
|
|
</div>
|
|
<div class="terms-tags">
|
|
{{ range $key, $value := $terms -}}
|
|
<a class="terms-link" href="{{ $name | relLangURL }}/{{ $value.Term | urlize }}{{ if $.Site.Params.uglyURLs }}.html{{else}}/{{ end }}">
|
|
{{ $value.Term }}
|
|
<span class="terms-count">{{ len $value.Pages }}</span>
|
|
</a>
|
|
{{ end -}}
|
|
</div>
|
|
</div>
|
|
{{- else if eq $name "tags" -}}
|
|
<div class="terms">
|
|
<div class="terms-title">
|
|
{{ if eq $length 0 -}}
|
|
{{ T "zeroTagCounter" }}
|
|
{{- else -}}
|
|
{{ T "tagCounter" $length }}
|
|
{{- end }}
|
|
</div>
|
|
<div class="terms-tags">
|
|
{{- range $key, $value := $terms }}
|
|
<a class="terms-link" href="{{ $name | relLangURL }}/{{ $value.Term | urlize }}{{ if $.Site.Params.uglyURLs }}.html{{else}}/{{ end }}">
|
|
{{ $value.Term }}
|
|
<span class="terms-count">{{ len $value.Pages }}</span>
|
|
</a>
|
|
{{ end -}}
|
|
</div>
|
|
</div>
|
|
{{- end }}
|
|
{{- end }}
|