aboutsummaryrefslogtreecommitdiff
path: root/themes/default/layouts/_default/taxonomy.html
blob: e43bc29d3ecf1eb872379d9a47ab7b0bd4636154 (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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
{{ define "styles" }}
<style>
  {{ partial "styles-navigator.html" (dict "Link" "/tags/") | safeCSS }}
</style>
{{ end }}

{{ define "middle" }}

  {{ $title := .Title }}

  {{ if eq .Title "Tags" }}

    {{ partial "navigator-middle.html"
      (dict
        "Title"      "Tags"
        "Subtitle"   (partial "count-tags.html" .)
        "Icon"       "arrow-left"
        "IconLabel"  "Back"
        "Href"       "/"
        "Id"         "back"
        "Context"    .
      )
    }}

    {{ $page  := 1 }}
    {{ $count := 0 }}

    {{ range .Paginator.Pages }}
    {{ $title := lower .Title }}
      <item-list>
        <h1><a href="/tags/{{ $title }}">#{{ .Title }}</a></h1>
        <ul>
          {{ range .Pages }}
          {{ $count = add $count 1 }}
            <li>
              <a
                title="{{ partial "title.html" . }}"
                href="/tags/{{ $title }}/{{ if gt $page 1 }}page/{{ $page }}/{{ end }}#{{ partial "card-id.html" . }}">
                <span>{{ .Date.Format "02 Jan 2006" }}</span>
                <span>{{ partial "title.html" . }}</span>
                <span>@{{ partial "author-user.html" . }}</span>
              </a>
            </li>
            {{ if eq (mod $count $.Paginator.PageSize) 0 }}
              {{ $page = add $page 1 }}
            {{ end }}
           {{ end }}
           {{ $page  = 1 }}
           {{ $count = 0 }}
        </ul>
      </item-list>
    {{ end }}

    {{ partial "pagination.html" . }}

  {{ end }}

{{ end }}

{{ define "right" }}
  {{- partial "navigator-right-default.html" . -}}
{{ end }}