~nykma/hugo-theme-jane unlisted

ref: f814ff890a58426551dfc30c27e15f7e739d472d hugo-theme-jane/layouts/_default/taxonomy.html -rw-r--r-- 1.9 KiB View raw
f814ff89Nyk Ma [#][CSS] details summary a month ago
                                                                                
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
{{ define "title" -}}
{{ if eq .Data.Singular "author" -}}
  {{- $author := (index (.Site.Data.authors | default dict) .Title) -}}
  {{- $author_lang := (index ($author | default dict) .Site.Language.Lang) -}}
  {{- $author_name := $author_lang.name.display | default $author.name.display | default .Title -}}
  {{ $author_name }} · {{ .Site.Title }}
{{- else -}}
  {{ .Title }} · {{ .Site.Title }}
{{- end }}
{{- end }}

{{ define "content"}}
{{ $paginator := .Paginate (where .Data.Pages.ByDate.Reverse "Type" "post") (index .Site.Params "archive-paginate" | default 10) }}
<section id="archive" class="archive">
  {{ if not $paginator.HasPrev }}
    {{ if eq .Data.Plural "tags" }}
      <div class="archive-title tag">
        <h2 class="archive-name">{{ i18n "tag" }}{{ .Title }}</h2>
      </div>
    {{ else if eq .Data.Plural "categories" }}
      <div class="archive-title category">
        <h2 class="archive-name">{{ i18n "category" }}{{ .Title }}</h2>
      </div>
    {{ else if eq .Data.Singular "author" }}
      {{- $author := (index (.Site.Data.authors | default dict) .Title) -}}
      {{- $author_lang := (index ($author | default dict) .Site.Language.Lang) -}}
      {{- $author_name := $author_lang.name.display | default $author.name.display | default .Title -}}
      <div class="archive-title author">
        <h2 class="archive-name">{{ i18n "author_item" }}{{ $author_name }}</h2>
      </div>
    {{ end }}
  {{ end }}

  {{ range $paginator.Pages }}
    <div class="archive-post">
      <time datetime="{{ .Date.Format "2006-01-02" }}" class="archive-post-time">
        {{ .Date.Format (.Site.Params.dateFormatToUse | default "2006-01-02") }}
      </time>
      <span class="archive-post-title">
        <a href="{{ .RelPermalink }}" class="archive-post-link">
          {{ .Title }}
        </a>
      </span>
    </div>
  {{ end }}
</section>

<!-- pagination -->
{{ partial "pagination.html" . }}

{{ end }}