diff options
Diffstat (limited to 'layouts/_default/terms.html')
-rw-r--r-- | layouts/_default/terms.html | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/layouts/_default/terms.html b/layouts/_default/terms.html new file mode 100644 index 0000000..e76cde8 --- /dev/null +++ b/layouts/_default/terms.html @@ -0,0 +1,44 @@ +{{- 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 }} |