summaryrefslogtreecommitdiff
path: root/layouts/_default/section.html
blob: c051990e1598ebc5819e94856a1bbd3451e76f96 (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
{{ define "main" }}
    <article class="posts">
      {{ partial "header.html" . }}
      <div id="posts-archive" class="posts-list">
        <!-- Post Archive List -->
        {{ $remainingMonthsToOpen := 3 }}
        {{ range (where site.RegularPages "Type" "eq" "posts").GroupByDate "2006" -}}
          <section class="posts-year-archive">
            <h1 class="posts-year-title">
                {{ .Key }}
                <small class="font-mono">{{ T "archivePage.postCountAnnual" (len .Pages) }}</small>
            </h1>

            {{ range .Pages.GroupByDate "January" }}
            <details class="posts-month-archive"{{ if gt $remainingMonthsToOpen 0 }} open{{ end }}>
                <summary>
                    <h2 class="posts-month-title">
                        {{ .Key }}
                        <small class="font-mono">{{ T "archivePage.postCountMonthly" (len .Pages) }}</small>
                    </h2>
                </summary>
                <div class="term-list">
                    <ul class="term-list-posts">
                      {{ range .Pages }}
                        <li>
                          <div style="display: flex; gap: 1rem;">
                              <time class="font-mono">
                                  {{ .Date.Format "Jan 02" }}
                              </time>
                              <a href="{{ .Permalink }}">
                                  {{ .Title }}
                              </a>
                          </div>
                          <div class="posts-item-category">
                              {{ with .Params.categories }}
                                  <a href="/categories/{{ . }}">
                                      {{ . }}
                                  </a>
                              {{ end }}
                          </div>
                        </li>
                      {{ end }}
                    </ul>
                </div>
            </details>
            {{ $remainingMonthsToOpen = sub $remainingMonthsToOpen 1 }}
            {{ end }}
          </section>
        {{ end }}
      </div>
    </article>
    {{ partial "footer.html" . }}
{{ end }}