aboutsummaryrefslogtreecommitdiff
path: root/generators/hugo/themes/tdro/layouts/_default/taxonomy.html
blob: ec5a71f08bac5e3f1263246f604b156a4025da5b (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
63
64
65
66
67
68
{{ define "main" }}
  {{ $sidenote := "<margin-note right>See an archive of all taxonomies <a href=\"/archives/tags/\">here.</a></margin-note>" }}
  {{ $title := .Title }}
  {{ if eq $title "Tags" }}
    <main>
      <taxonomy-list>
      {{ safeHTML $sidenote }}
      <h1>Taxonomies</h1>
      <hr>
      <section>
        {{ range .Paginator.Pages }}
          {{ $title := .Title }}
          <h2>{{ .Title | title }}</h2>
          {{- range $taxonomy := .Site.Taxonomies -}}
            {{- range $tag, $article := $taxonomy -}}
              {{ if eq $tag $title }}
              <ul>
                {{ range $article.Pages }}
                <li>
                  <a title="{{ .Title }}" href="{{ .RelPermalink }}">
                    <code><time datetime="{{ dateFormat "2006-01-02" .Date }}">{{ .Date.Format "02 Jan 2006" }}</time></code>
                    <span>{{ .Title }}</span>
                  </a>
                </li>
                {{ end }}
              </ul>
              {{ end }}
            {{- end -}}
          {{- end -}}
        {{- end -}}
      </section>
      {{ partial "article-pagination.html" . }}
      </taxonomy-list>
    </main>
  {{ else  }}
    <main>
      <taxonomy-list>
      {{ safeHTML $sidenote }}
      <h1>
        {{ if ne $title "Tags" }}
          <a href="/{{ .Data.Plural }}/">Tags</a>
          <span>&mdash;</span>
          <span>{{ .Title | title }}</span>
        {{ end }}
      </h1>
      <hr>
      <section>
        {{- range $taxonomy := .Site.Taxonomies -}}
          {{- range $tag, $article := $taxonomy -}}
            {{- if eq $tag $title -}}
            <ul>
              {{ range $article.Pages }}
              <li>
                <a title="{{ .Title }}" href="{{ .RelPermalink }}">
                  <code><time datetime="{{ dateFormat "2006-01-02" .Date }}">{{- .Date.Format "02 Jan 2006" -}}</time></code>
                  <span>{{- .Title | markdownify -}}</span>
                </a>
              </li>
              {{ end }}
            </ul>
            {{- end -}}
          {{- end -}}
        {{- end -}}
      </section>
      </taxonomy-list>
    </main>
  {{ end }}
{{ end }}