Welcome to mirror list, hosted at ThFree Co, Russian Federation.

terms.html « _default « layouts - github.com/xianmin/hugo-theme-jane.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 569ea3f5759bcb81371761a70239e45469e7acf9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
{{ define "title" }}{{ i18n .Data.Plural }} - {{ .Site.Title }}{{ end }}

{{ define "content" }}
  {{ $name := .Data.Plural -}}
  {{ $terms := .Data.Terms.ByCount -}}
  {{ $length := len $terms -}}
  {{ if eq $name "categories" }}
    <div class="categories">
      <div class="categories-title">
          {{ i18n "counter_categories" $length }}
      </div>
      <div class="categories-tags">
        {{ range $key, $value := $terms }}
          <a class="category-link" href="{{ $name | urlize | relURL }}/{{ $value.Term | urlize }}/">
            {{ $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">
          {{ i18n "counter_tagcloud" $length}}
      </div>
      <div class="tag-cloud-tags">
        {{ range $key, $value := $terms }}
          <a href="{{ $name | urlize | relURL }}/{{ $value.Term | urlize }}/">
            {{ $value.Term }}
            <span class="tag-count">{{ len $value.Pages }}</span>
          </a>
        {{ end }}
      </div>
    </div>
  {{ end }}
{{ end }}