summaryrefslogtreecommitdiff
path: root/layouts/struct/section.html
diff options
context:
space:
mode:
authorEltrac <hi@guhub.cn>2025-11-27 21:44:09 +0800
committerEltrac <hi@guhub.cn>2025-11-27 21:44:09 +0800
commit769de5ae4954bda33ee73a76b2df975eee74a125 (patch)
tree0012baddf2f9fdf1278b2f16f7b1a7e9544593fd /layouts/struct/section.html
parenta8f987fb5e0aaea7e4a115ee09ea4e962d5c7a8c (diff)
feat: new sections "pour" and "struct"
Former-commit-id: 3f50451e2857abde4d0777f90816697304071bbb
Diffstat (limited to 'layouts/struct/section.html')
-rw-r--r--layouts/struct/section.html37
1 files changed, 37 insertions, 0 deletions
diff --git a/layouts/struct/section.html b/layouts/struct/section.html
new file mode 100644
index 00000000..183dec14
--- /dev/null
+++ b/layouts/struct/section.html
@@ -0,0 +1,37 @@
+{{ define "main" }}
+ <article>
+ {{ partial "header.html" . }}
+ <div class="posts-list pagefind-exclude">
+ <div class="markdown-body">{{ .Content }}</div>
+ <!-- Post Archive List -->
+ {{ $remainingMonthsToOpen := 3 }}
+ {{ range (where site.RegularPages "Type" "eq" "struct").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="posts-month-archive"{{ 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 }}