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

45 lines
1.4 KiB
HTML
Raw Normal View History

{{- define "title" }}{{ T .Data.Plural }} - {{ .Site.Title }}{{ end -}}
2017-08-27 14:38:42 +00:00
{{- define "content" -}}
2017-08-27 14:38:42 +00:00
{{ $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 -}}
2018-01-31 14:07:50 +00:00
{{ T "zeroCategoryCounter" }}
{{- else -}}
2018-01-31 14:07:50 +00:00
{{ T "categoryCounter" $length }}
{{- end }}
2017-08-27 14:38:42 +00:00
</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 }}">
2017-08-27 14:38:42 +00:00
{{ $value.Term }}
<span class="terms-count">{{ len $value.Pages }}</span>
2017-08-27 14:38:42 +00:00
</a>
{{ end -}}
2017-08-27 14:38:42 +00:00
</div>
</div>
{{- else if eq $name "tags" -}}
<div class="terms">
<div class="terms-title">
{{ if eq $length 0 -}}
2018-01-31 14:07:50 +00:00
{{ T "zeroTagCounter" }}
{{- else -}}
2018-01-31 14:07:50 +00:00
{{ T "tagCounter" $length }}
{{- end }}
2017-08-27 14:38:42 +00:00
</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 }}">
2017-08-27 14:38:42 +00:00
{{ $value.Term }}
<span class="terms-count">{{ len $value.Pages }}</span>
2017-08-27 14:38:42 +00:00
</a>
{{ end -}}
2017-08-27 14:38:42 +00:00
</div>
</div>
{{- end }}
{{- end }}