summaryrefslogtreecommitdiff
path: root/layouts/section.html
diff options
context:
space:
mode:
authorEltrac <hi@guhub.cn>2025-07-14 19:05:44 +0800
committerEltrac <hi@guhub.cn>2025-07-14 19:05:44 +0800
commit3cb68b6d5231ac9932b521dee767aae19ae1ca60 (patch)
treed19a8819ab59b68498c049b270582c5a30371e9d /layouts/section.html
parent54b306460dd67be4c0f41dee3d8ec5d6014178a7 (diff)
refactor: keep layouts folder structure up to standards
Former-commit-id: 44c7def3f6958550ccf965971f1819c1d6c514f1
Diffstat (limited to 'layouts/section.html')
-rw-r--r--layouts/section.html53
1 files changed, 53 insertions, 0 deletions
diff --git a/layouts/section.html b/layouts/section.html
new file mode 100644
index 00000000..c051990e
--- /dev/null
+++ b/layouts/section.html
@@ -0,0 +1,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 }}