summaryrefslogtreecommitdiff
path: root/layouts/section.html
diff options
context:
space:
mode:
authorEltrac <hi@guhub.cn>2025-11-27 23:35:37 +0800
committerEltrac <hi@guhub.cn>2025-11-27 23:35:37 +0800
commit5cb1c7eb72fad939bcc76be11e4b6149f37618e1 (patch)
tree338e937126b595840885a529b67c6b62b4ddbdbc /layouts/section.html
parentd56407e244a6b74f6f913507d63e03377cc86308 (diff)
feat: adapt to new content system - remove more posts link in homepage - more
latest content (posts, essays, library, fictions...) in homepage - use the same template for posts and essays - new post section list style - show section-specific categories in section page Former-commit-id: 9a478cf5ee77a32b83dbe8f03d7ed8e83247937f
Diffstat (limited to 'layouts/section.html')
-rw-r--r--layouts/section.html40
1 files changed, 29 insertions, 11 deletions
diff --git a/layouts/section.html b/layouts/section.html
index d3fe3ac4..3ddc6bb7 100644
--- a/layouts/section.html
+++ b/layouts/section.html
@@ -1,11 +1,19 @@
{{ define "main" }}
+
+ {{ $pages := .Pages }}
+ {{ $categories := slice }}
+
<article>
{{ partial "header.html" . }}
<div class="posts-list pagefind-exclude">
<div class="markdown-body">{{ .Content }}</div>
+
+ {{ partial "section-categories" $pages }}
+ <p class="text-secondary text-sm">*稻草人周刊也属于散文集,但为了方便查阅,周刊没有列在下面,请到<a href="/categories/稻草人周刊/">分类页面</a>查看周刊。</p>
+
<!-- Post Archive List -->
{{ $remainingMonthsToOpen := 3 }}
- {{ range (where site.RegularPages "Type" "eq" "posts").GroupByDate "2006" -}}
+ {{ range $pages.GroupByDate "2006" -}}
<section class="w-full">
{{ partial "components/section-title" (dict
"Left" .Key
@@ -13,20 +21,30 @@
)}}
{{ 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>
+ <div class="posts-month-archive"{{ 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 }}
- {{ partial "items/post-small" . }}
+ {{ $isWeekly := (eq .Params.categories "稻草人周刊") }}
+ {{ if not (eq .Params.categories "稻草人周刊") }}
+ <li class="flex gap-4 text-size-lg">
+ <span class="text-size-xs h-5 font-mono text-secondary flex-shrink-0
+ inline-block border-1 border-solid border-t-5 px-1
+ border-neutral-200 dark:border-neutral-700">
+ {{ .Date.Format "02" }}
+ </span>
+ <a href="{{ .RelPermalink }}">
+ {{ .Title }}{{ with .Params.subtitle }}:<span class="text-secondary">{{. }}</span>
+ {{ end }}
+ </a>
+ </li>
+ {{ end }}
{{ end }}
</ul>
- </details>
+ </div>
{{ $remainingMonthsToOpen = sub $remainingMonthsToOpen 1 }}
{{ end }}
</section>