summaryrefslogtreecommitdiff
path: root/layouts/weekly/section.html
blob: 5c9ded08def604e3c656add1cb693a5595e6ff99 (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
{{ define "main" }}
    {{ $pages := .Pages }}
    {{ $categories := slice }}

    <article>
      <div class="posts-list pagefind-exclude">
        <div class="markdown-body">{{ .Content }}</div>

        <!-- Post Archive List -->
        {{ $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" }}
            <div class="lazy-render"{{ if gt $remainingMonthsToOpen 0 }} open{{ end }}>
                <h2 class="text-size-lg inline-block w-full m-0
                    flex justify-between items-center">
                    {{ .Key }}
                </h2>
                <ul class="ps-0 flex flex-col gap-2 list-none leading-relaxed">
                    {{ range .Pages }}
                        {{ .Render "view_item" }}
                    {{ end }}
                </ul>
            </div>
            {{ $remainingMonthsToOpen = sub $remainingMonthsToOpen 1 }}
            {{ end }}
          </section>
        {{ end }}
      </div>
    </article>
{{ end }}