aboutsummaryrefslogtreecommitdiff
path: root/themes/default/layouts/_default/home.archives.html
blob: f443583a293dea74f54c3e661510a7b7fa3dbaf1 (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
{{- define "title" -}}Archives — {{ end -}}
{{- define "description" -}}An archive of all items — {{ end -}}
{{- define "styles" -}}
<style>
  {{ partial "navigator.css.html" (dict "Link" "/archives/") | safeCSS }}
</style>
{{- end -}}

{{- define "header" -}}
  {{- partial "navigator-middle.html"
    (dict
      "Context"    .
      "IconLabel"  "Back"
      "Id"         "back"
      "Title"      "Archives"
      "Icon"       "arrow-left"
      "Subtitle"   (print (partial "count.html" .) " " "Total")
      "Href"       (or (and (gt .Paginator.PageNumber 1) (.Paginator.Prev.URL | absURL)) "/")
    )
  -}}
{{- end -}}

{{- define "middle" -}}
  <archive-list>
    <time-line>
    {{ range (.Paginator.Pages.GroupByDate "2006") }}
      {{ range (first 1 .Pages) }}
      <h1>{{ .Date | time.Format "2006" }}</h1>
      {{ end }}
      <ul>
        {{ range .Pages }}
          {{- $author := .Page.Section -}}
          <li>
            <a
              title="{{ partial "meta-title.html" . }}"
              href="{{ .Permalink }}#{{ partial "card-id.html" . }}"
            >
              <code>
                <time
                  data-type="disabled"
                  datetime="{{ .Date | time.Format "2006-01-02T15:04:05Z" }}"
                  title="{{ .Date | time.Format "Posted: Monday January 2 2006 at 15:04:05 MST" }}"
                >
                  {{ .Date | time.Format "02 Jan" }}
                </time>
              </code>
              <section>
                <h2>{{ partial "meta-title.html" . }}</h2>
                <p>@{{ or .Params.feed.domain $author }}</p>
              </section>
            </a>
          </li>
        {{ end }}
      </ul>
    {{ end }}
    </time-line>
  </archive-list>
{{- end -}}

{{- define "footer" -}}
  {{- partial "pagination.html" . -}}
  {{- partial "footer.html" . -}}
{{- end -}}

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