summaryrefslogtreecommitdiff
path: root/layouts/article/section.html
blob: b56b30eb13e2d17f81e1ed4d684953f6eb1399e3 (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
{{ define "main" }}

    {{ $pages := .Pages }}
    {{ $categories := slice }}

    <article>
      {{ partial "header.html" . }}
      {{ partial "home/home-nav" . }}
      <div class="posts-list pagefind-exclude">
        <div class="markdown-body">{{ .Content }}</div>

        {{ $remainingMonthsToOpen := 3 }}
        {{ range $pages.GroupByDate "2006" -}}
          <section class="w-full">
            {{ partial "components/section-title" (dict
                "Left" .Key
                "Right" (T "archivePage.postCountAnnual" (len .Pages))
            )}}

            {{ range .Pages.GroupByDate "January" }}
            <details class="lazy-render"{{ if gt $remainingMonthsToOpen 0 }} open{{ end }}>
                <summary class="flex items-center border-b border-b-dashed border-[var(--border-color)] py-2 px-1">
                    <h2 class="text-size-lg inline-block w-full m-0
                        flex justify-between items-center">
                        {{ .Key }}
                        <small class="font-mono text-secondary text-3">{{ T "archivePage.postCountMonthly" (len .Pages) }}</small>
                    </h2>
                </summary>
                <ul class="ps-0 flex flex-col gap-2 list-none leading-relaxed">
                    {{ range .Pages }}
                    {{ partial "items/post-small" . }}
                    {{ end }}
                </ul>
            </details>
            {{ $remainingMonthsToOpen = sub $remainingMonthsToOpen 1 }}
            {{ end }}
          </section>
        {{ end }}
      </div>
    </article>
    {{ partial "footer.html" . }}
{{ end }}