From 666022b097de6b18b5432b9fb59fd3aa39afe5e8 Mon Sep 17 00:00:00 2001 From: yingyu5658 Date: Mon, 29 Dec 2025 21:19:05 +0800 Subject: feat: Add a switch of comments --- archetypes/default.md | 5 +++-- content/about.md | 3 ++- content/archives.md | 2 ++ content/categories.md | 3 +++ content/links.md | 3 ++- content/readings.md | 3 ++- hugo.toml | 5 ++++- layouts/_default/single.html | 28 +++++++++------------------- 8 files changed, 27 insertions(+), 25 deletions(-) diff --git a/archetypes/default.md b/archetypes/default.md index 2f61dae..547bc04 100644 --- a/archetypes/default.md +++ b/archetypes/default.md @@ -1,10 +1,11 @@ --- -date: '{{ .Date }}' -draft: true title: '{{ replace .File.ContentBaseName "-" " " | title }}' +date: '{{ .Date }}' slug: '' categories: - tags: - +draft: true +comments: true --- diff --git a/content/about.md b/content/about.md index 9360d36..a709f27 100644 --- a/content/about.md +++ b/content/about.md @@ -1,7 +1,8 @@ --- date: 2025-02-26T20:31:14+08:00 title: 关于 -type: no-comments +comments: false +showMeta: false --- > 📌 如果想获得最新动态,可以加入本博客的Telegram频道[「🌊 央山常量池」](https://t.me/glowisle/),有博客选题、观察思考,还有我的碎碎念。 > diff --git a/content/archives.md b/content/archives.md index 8e8196d..de873df 100644 --- a/content/archives.md +++ b/content/archives.md @@ -1,4 +1,6 @@ --- title: "归档" type: "archives" +comments: false +showMeta: false --- diff --git a/content/categories.md b/content/categories.md index 2f6f19c..f486d99 100644 --- a/content/categories.md +++ b/content/categories.md @@ -1,7 +1,10 @@ --- type: no-comments title: 分类 +comments: false +showMeta: false --- + ### [💭 随笔](/categories/随笔) 记录事情 | 抒发观点 | 发表议论 diff --git a/content/links.md b/content/links.md index 9d0eddb..c14e271 100644 --- a/content/links.md +++ b/content/links.md @@ -1,7 +1,8 @@ --- date: "2025-06-07T13:08:07+08:00" title: 友人 -type: no-comments +comments: false +showMeta: false --- | Link | Description | | -------------------------------------------- | -------------------------------------------------- | diff --git a/content/readings.md b/content/readings.md index 6710650..174a6d1 100644 --- a/content/readings.md +++ b/content/readings.md @@ -1,7 +1,8 @@ --- date: "2025-06-07T13:08:07+08:00" title: 读书 -type: no-comments +comment: false +showMeta: false --- 这里记录着我读过的书,有时候写写书评或读后感,你可以在[读书](/categories/读书/)页面查看所有与书籍有关的文章。 diff --git a/hugo.toml b/hugo.toml index 2f68194..0e47c49 100644 --- a/hugo.toml +++ b/hugo.toml @@ -54,7 +54,7 @@ unsafe = true description = "关于互联网、书籍、生活琐事以及那些一闪而过的念头。计算机技术 & 读书感悟 & 日常随笔。映屿(GlowIsle)" postSearch = false groupByYear = true - toc = true + toc = false showPostCount = true favicon = "/favicon.png" hideMadeWithLine = true @@ -63,3 +63,6 @@ unsafe = true [params.author] name = "五葉地錦" email = "i@glowisle.me" + + [params.footer] + content = "© 2024 - 2025 | Made with ❤️ by Verdant" diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 8c26440..8b8f326 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -4,7 +4,7 @@

{{ .Title }}

- +{{ if ne (.Params.showMeta | default true) false }} +{{ end }}
{{ .Content }}
@@ -135,6 +136,8 @@ {{ $tocEnabled := default .Site.Params.toc .Params.toc }} {{ if $tocEnabled }}
{{ partial "toc.html" . }}
{{ end }} + +{{ if .Params.comments }}
@@ -182,26 +185,10 @@ - {{ end }} +{{ end }} -- cgit v1.2.3