summaryrefslogtreecommitdiff
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
commit3f50451e2857abde4d0777f90816697304071bbb (patch)
tree03bee2f66e16892d17c310fcd384f590fc0c30c1
parent61c64333be61dbc3ed3a330b0b2095c5f9fd8873 (diff)
feat: new sections "pour" and "struct"
-rw-r--r--config/_default/params.yaml2
-rw-r--r--config/_default/params.zh.yaml7
-rw-r--r--content/pour/_index.md5
-rw-r--r--content/struct/_index.md5
-rw-r--r--layouts/pour/section.html37
-rw-r--r--layouts/struct/section.html37
6 files changed, 91 insertions, 2 deletions
diff --git a/config/_default/params.yaml b/config/_default/params.yaml
index 0067f26b..37990990 100644
--- a/config/_default/params.yaml
+++ b/config/_default/params.yaml
@@ -2,6 +2,8 @@ author: Eltrac
email: hi@guhub.cn
mainSections:
- posts
+ - pour
+ - struct
- fictions
- library
favicon: /favicon.png
diff --git a/config/_default/params.zh.yaml b/config/_default/params.zh.yaml
index 2b34931a..47fd65ea 100644
--- a/config/_default/params.zh.yaml
+++ b/config/_default/params.zh.yaml
@@ -1,7 +1,10 @@
description: 欢迎来访,这里只有真情流露和赤裸的思考。
nav:
- - name: 议叙
- link: /posts/
+ - name: 结构
+ link: /struct/
+ target: _self
+ - name: 倾泻
+ link: /pour/
target: _self
- name: 书目
link: /library/
diff --git a/content/pour/_index.md b/content/pour/_index.md
new file mode 100644
index 00000000..0f7df890
--- /dev/null
+++ b/content/pour/_index.md
@@ -0,0 +1,5 @@
+---
+title: 散文集
+---
+
+赤裸的情感和思考在这里**倾泻**而下。
diff --git a/content/struct/_index.md b/content/struct/_index.md
new file mode 100644
index 00000000..1b496dd1
--- /dev/null
+++ b/content/struct/_index.md
@@ -0,0 +1,5 @@
+---
+title: 好奇心
+---
+
+在无边信息海洋里,我的武装。
diff --git a/layouts/pour/section.html b/layouts/pour/section.html
new file mode 100644
index 00000000..a95571a8
--- /dev/null
+++ b/layouts/pour/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" "pour").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 }}
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 }}