From 109e1f4b37002c267b5096366c59ef44bc20eab8 Mon Sep 17 00:00:00 2001 From: Eltrac Date: Sat, 31 May 2025 09:57:10 +0800 Subject: chore(umami): track more events chore(umami): track more events Former-commit-id: bcb3451a3448682dc4eed1edac74ab8d29705c52 --- layouts/partials/components/comment.html | 5 +++-- layouts/partials/components/global-search.html | 2 ++ layouts/partials/components/postnav.html | 11 ++++++----- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/layouts/partials/components/comment.html b/layouts/partials/components/comment.html index 2bdab023..9d190cfd 100644 --- a/layouts/partials/components/comment.html +++ b/layouts/partials/components/comment.html @@ -27,11 +27,12 @@ {{ if eq .Site.Language.Lang "zh" }} {{ end }} diff --git a/layouts/partials/components/global-search.html b/layouts/partials/components/global-search.html index ab4ec5ff..d60f2f20 100644 --- a/layouts/partials/components/global-search.html +++ b/layouts/partials/components/global-search.html @@ -92,6 +92,8 @@ const turnOn = () => { search.classList.add("shown"); overlay.classList.add("shown"); + + umami.track('🔍 Open search panel') }; const turnOff = () => { search.classList.remove("shown"); diff --git a/layouts/partials/components/postnav.html b/layouts/partials/components/postnav.html index 5ada95e2..0174060c 100644 --- a/layouts/partials/components/postnav.html +++ b/layouts/partials/components/postnav.html @@ -1,24 +1,25 @@
-- cgit v1.2.3 From 6e9ff02c486feae1fcc384fda479823b34a52baa Mon Sep 17 00:00:00 2001 From: Eltrac Date: Sat, 31 May 2025 10:04:15 +0800 Subject: docs: update draft Former-commit-id: a15fc9a27b2466a123d26d3eb61db68cdfdf6db7 --- content/posts/weekly/31.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/posts/weekly/31.md b/content/posts/weekly/31.md index 1ce39258..a97de53b 100644 --- a/content/posts/weekly/31.md +++ b/content/posts/weekly/31.md @@ -10,7 +10,7 @@ draft: true toc: true --- - + ## 🙋 在做什么 -- cgit v1.2.3 From e5d0c521b9ed1792ba1f0c7a46788d7aaa643023 Mon Sep 17 00:00:00 2001 From: Eltrac Date: Sat, 31 May 2025 10:06:28 +0800 Subject: chore(umami): mark all event names with emojis chore(umami): more events and identify them with emojis Former-commit-id: 9be56251908c59206bad77bc0da270a868961635 --- layouts/_default/featured.html | 2 +- layouts/_default/uncategorized.html | 2 +- layouts/categories/taxonomy.html | 2 +- layouts/categories/term.html | 2 +- layouts/index.html | 8 ++++---- layouts/partials/components/comment.html | 4 ++-- layouts/partials/header.html | 4 ++-- layouts/posts/single.html | 2 +- layouts/term/term.html | 4 ++-- 9 files changed, 15 insertions(+), 15 deletions(-) diff --git a/layouts/_default/featured.html b/layouts/_default/featured.html index 5b921e05..8b599d27 100644 --- a/layouts/_default/featured.html +++ b/layouts/_default/featured.html @@ -27,7 +27,7 @@

{{ if eq .Section "library" }} 读《{{ .Title }}》 diff --git a/layouts/_default/uncategorized.html b/layouts/_default/uncategorized.html index afec928a..d29fa2e8 100644 --- a/layouts/_default/uncategorized.html +++ b/layouts/_default/uncategorized.html @@ -12,7 +12,7 @@
    {{ range $uncategorized }}
  1. - + {{ .Title }}{{ with .Params.subtitle }}:{{. }} {{ end }} diff --git a/layouts/categories/taxonomy.html b/layouts/categories/taxonomy.html index 22c99a6d..38b96fdc 100644 --- a/layouts/categories/taxonomy.html +++ b/layouts/categories/taxonomy.html @@ -11,7 +11,7 @@
    diff --git a/layouts/categories/term.html b/layouts/categories/term.html index a1ed5c51..6b647739 100644 --- a/layouts/categories/term.html +++ b/layouts/categories/term.html @@ -14,7 +14,7 @@
    + data-umami-event="➕ Click more posts link"> {{ T "moreLinks.posts" }} @@ -73,7 +73,7 @@

    {{ .Title }}

    {{- if .Params.tags }} @@ -93,7 +93,7 @@ diff --git a/layouts/partials/components/comment.html b/layouts/partials/components/comment.html index 9d190cfd..13fff97e 100644 --- a/layouts/partials/components/comment.html +++ b/layouts/partials/components/comment.html @@ -28,11 +28,11 @@ {{ if eq .Site.Language.Lang "zh" }} {{ end }} diff --git a/layouts/partials/header.html b/layouts/partials/header.html index 92e81353..8213690a 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -16,7 +16,7 @@ @@ -24,7 +24,7 @@ {{- $lang := .Site.Language.Lang -}} {{- $switch := dict "en" (dict "url" "/zh/" "label" "切换至中文") "zh" (dict "url" "/en/" "label" "Switch to English") -}} {{- $entry := index $switch $lang -}} - {{ partial "snippets/globe-icon" . }} diff --git a/layouts/posts/single.html b/layouts/posts/single.html index 0fe65678..ced18720 100644 --- a/layouts/posts/single.html +++ b/layouts/posts/single.html @@ -84,7 +84,7 @@

    {{ T "nowReadThis" }}

    {{ range . }}
    - + {{ .LinkTitle }} {{ with .Params.subtitle }} :{{ . }} diff --git a/layouts/term/term.html b/layouts/term/term.html index 2ecd7b12..2c9a4d59 100644 --- a/layouts/term/term.html +++ b/layouts/term/term.html @@ -9,7 +9,7 @@
      {{ range where .Pages "Section" "not in" (slice "cards" "library") }}
    • - + {{ .Title }}{{ with .Params.subtitle }}:{{. }} {{ end }} @@ -28,7 +28,7 @@ {{ range $cards }}

      - + {{ .Title }}

      -- cgit v1.2.3 From 87761df9fde0885d64a4eb853c18245ca0779ce3 Mon Sep 17 00:00:00 2001 From: Eltrac Date: Sat, 31 May 2025 10:10:56 +0800 Subject: fix: typo Former-commit-id: 39888ad4d4cdc4649a5eed076aab07a1a514efc0 --- layouts/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layouts/index.html b/layouts/index.html index bae5aded..1074574f 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -93,7 +93,7 @@
      -- cgit v1.2.3 From ada28d9601e894f88ecac108e8dc94950a948a03 Mon Sep 17 00:00:00 2001 From: Eltrac Date: Fri, 6 Jun 2025 10:51:13 +0800 Subject: docs: misplaced content Former-commit-id: fa164c096336196b720c50333b2015b3f0940b5d --- ...256\227\346\200\247\347\220\206\350\256\272.md" | 41 ++++++++++++++++++++++ ...256\227\346\200\247\347\220\206\350\256\272.md" | 41 ---------------------- 2 files changed, 41 insertions(+), 41 deletions(-) create mode 100644 "content/cards/\345\233\276\347\201\265\346\234\272\345\222\214\345\217\257\350\256\241\347\256\227\346\200\247\347\220\206\350\256\272.md" delete mode 100644 "content/\345\233\276\347\201\265\346\234\272\345\222\214\345\217\257\350\256\241\347\256\227\346\200\247\347\220\206\350\256\272.md" diff --git "a/content/cards/\345\233\276\347\201\265\346\234\272\345\222\214\345\217\257\350\256\241\347\256\227\346\200\247\347\220\206\350\256\272.md" "b/content/cards/\345\233\276\347\201\265\346\234\272\345\222\214\345\217\257\350\256\241\347\256\227\346\200\247\347\220\206\350\256\272.md" new file mode 100644 index 00000000..86bf99a0 --- /dev/null +++ "b/content/cards/\345\233\276\347\201\265\346\234\272\345\222\214\345\217\257\350\256\241\347\256\227\346\200\247\347\220\206\350\256\272.md" @@ -0,0 +1,41 @@ +--- +title: 图灵机和可计算性理论 +tags: + - 计算机 +date: 2025-06-04T22:53:00 +--- + +图灵机(Turing machine)是一种理想的计算模型,是一种假想的由纸带、读写头和一定计算规则组成的机器,可以用来模拟任何可以计算的问题。你可以把图灵机理解为一种抽象的、通用的计算机。 + +#### 图灵可计算性 + +如果一个函数可以被图灵机计算并得出答案,这个函数就具有图灵可计算性(Turing-computability)。从现实层面来讲,任何可以在计算机上模拟的问题都是图灵可计算的,只要这个问题可以由计算机程序给出答案而不会陷入死循环。 + +停机问题(Halting Problem)不是图灵可计算的,它要求计算机判断一个程序在给定的输入下会停机还是会陷入死循环。图灵机和任何计算机都不能解决它。 + +```C +// 停机问题的伪代码表示 +int H(procedure,Input); +int U(P) +{ + while(H(P,P)){} + return 0; +} +``` + +#### 图灵完备 + +如果一个系统(一系列操作数据的规则)可以模拟图灵机(Turing machine),就说它是**图灵完备**的(Turing-complete)。简单来说,具有图灵完备性的系统可以识别另一个系统的数据操作规则,图灵完备的计算机或计算机语言可以模拟另一种计算机或计算机语言的行为和用途。 + +- 几乎所有编程语言都是图灵完备的,这表示几乎所有编程语言都可以被用来重新编写由另一种编程语言实现的计算机程序,能实现其他语言也能实现的功能。如果一个编程语言能实现条件判断、循环和变量,它基本上就是图灵完备的。 +- 标记语言(数据语言)不是图灵完备的,比如 JSON、XML、HTML 和 Markdown,因为他们只能描述数据而不能描述行为。 + +如果一个系统是图灵完备的,那它就可以被用来模拟另一个图灵完备的系统。也就是说,这两个系统是图灵等价的。 + +### 图灵等价 + +如果系统 A 可以模拟系统 B,而系统 B 也可以模拟系统 A,那么系统 A 和系统 B 就是**图灵等价**的。 + +所有图灵完备的系统都是图灵等价于图灵机的。 + +Source: [图灵完备性 - 维基百科,自由的百科全书](https://zh.wikipedia.org/zh-cn/圖靈完備性)、[可计算性理论 - 维基百科,自由的百科全书](https://zh.wikipedia.org/zh-cn/可计算性理论) \ No newline at end of file diff --git "a/content/\345\233\276\347\201\265\346\234\272\345\222\214\345\217\257\350\256\241\347\256\227\346\200\247\347\220\206\350\256\272.md" "b/content/\345\233\276\347\201\265\346\234\272\345\222\214\345\217\257\350\256\241\347\256\227\346\200\247\347\220\206\350\256\272.md" deleted file mode 100644 index 86bf99a0..00000000 --- "a/content/\345\233\276\347\201\265\346\234\272\345\222\214\345\217\257\350\256\241\347\256\227\346\200\247\347\220\206\350\256\272.md" +++ /dev/null @@ -1,41 +0,0 @@ ---- -title: 图灵机和可计算性理论 -tags: - - 计算机 -date: 2025-06-04T22:53:00 ---- - -图灵机(Turing machine)是一种理想的计算模型,是一种假想的由纸带、读写头和一定计算规则组成的机器,可以用来模拟任何可以计算的问题。你可以把图灵机理解为一种抽象的、通用的计算机。 - -#### 图灵可计算性 - -如果一个函数可以被图灵机计算并得出答案,这个函数就具有图灵可计算性(Turing-computability)。从现实层面来讲,任何可以在计算机上模拟的问题都是图灵可计算的,只要这个问题可以由计算机程序给出答案而不会陷入死循环。 - -停机问题(Halting Problem)不是图灵可计算的,它要求计算机判断一个程序在给定的输入下会停机还是会陷入死循环。图灵机和任何计算机都不能解决它。 - -```C -// 停机问题的伪代码表示 -int H(procedure,Input); -int U(P) -{ - while(H(P,P)){} - return 0; -} -``` - -#### 图灵完备 - -如果一个系统(一系列操作数据的规则)可以模拟图灵机(Turing machine),就说它是**图灵完备**的(Turing-complete)。简单来说,具有图灵完备性的系统可以识别另一个系统的数据操作规则,图灵完备的计算机或计算机语言可以模拟另一种计算机或计算机语言的行为和用途。 - -- 几乎所有编程语言都是图灵完备的,这表示几乎所有编程语言都可以被用来重新编写由另一种编程语言实现的计算机程序,能实现其他语言也能实现的功能。如果一个编程语言能实现条件判断、循环和变量,它基本上就是图灵完备的。 -- 标记语言(数据语言)不是图灵完备的,比如 JSON、XML、HTML 和 Markdown,因为他们只能描述数据而不能描述行为。 - -如果一个系统是图灵完备的,那它就可以被用来模拟另一个图灵完备的系统。也就是说,这两个系统是图灵等价的。 - -### 图灵等价 - -如果系统 A 可以模拟系统 B,而系统 B 也可以模拟系统 A,那么系统 A 和系统 B 就是**图灵等价**的。 - -所有图灵完备的系统都是图灵等价于图灵机的。 - -Source: [图灵完备性 - 维基百科,自由的百科全书](https://zh.wikipedia.org/zh-cn/圖靈完備性)、[可计算性理论 - 维基百科,自由的百科全书](https://zh.wikipedia.org/zh-cn/可计算性理论) \ No newline at end of file -- cgit v1.2.3 From 5f34075bc91718dc95c4a5e4036f6d55ce6248b8 Mon Sep 17 00:00:00 2001 From: Eltrac Date: Fri, 6 Jun 2025 11:19:41 +0800 Subject: docs: new cards Former-commit-id: 7ae3e1c60b41d0bbe79be2f164e4c6c6da21acf2 --- content/cards/liaison.md | 17 ++++++++++++++++ ...237\263\347\232\204\345\255\227\346\257\215.md" | 23 ++++++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 content/cards/liaison.md create mode 100644 "content/cards/\346\263\225\350\257\255\344\270\255\344\270\215\345\217\221\351\237\263\347\232\204\345\255\227\346\257\215.md" diff --git a/content/cards/liaison.md b/content/cards/liaison.md new file mode 100644 index 00000000..6d474212 --- /dev/null +++ b/content/cards/liaison.md @@ -0,0 +1,17 @@ +--- +title: 联诵 +tags: + - Français + - 语言 +date: 2025-06-06 11:19:27 +--- + +联诵(liaison)是法语的语法规则之一。当前一个词以辅音结尾(通常是[不发音的](/cards/法语中不发音的字母/)),后一个词以元音或哑音 h 开头,前一个词末尾的辅音会被激活,与后面的元音连接起来,使得语音连贯自然。 + +例子: + +- les^amis +- vouz^avez +- petit^enfants + +法语的联诵和英语的连读(linking sound)的区别在于:联诵是强制要求的语法规则,有正确和错误之分,而且联诵还会要求在发音时加入新的音素(即原本不发音的字母需要发音了);连读是自然的语音现象,连读的有无仅仅是口音的差别。 \ No newline at end of file diff --git "a/content/cards/\346\263\225\350\257\255\344\270\255\344\270\215\345\217\221\351\237\263\347\232\204\345\255\227\346\257\215.md" "b/content/cards/\346\263\225\350\257\255\344\270\255\344\270\215\345\217\221\351\237\263\347\232\204\345\255\227\346\257\215.md" new file mode 100644 index 00000000..7922ad6e --- /dev/null +++ "b/content/cards/\346\263\225\350\257\255\344\270\255\344\270\215\345\217\221\351\237\263\347\232\204\345\255\227\346\257\215.md" @@ -0,0 +1,23 @@ +--- +title: 法语中不发音的字母 +tags: + - Français + - 语言 +date: 2025-06-06 11:13:00 +--- + +Les lettres muettes: + +1. 单词末尾的 P、D、T、S、X 和 Z + - 如:froid、trois、petit、deux +2. 复数形式单词末尾的 S 和 X + - 如:châteaux、étoiles、voitures +3. 单词末尾的 E + - 如:table、pomme、robe、**porte**、vie + - 值得注意的是,在末尾有 E 的情况下,在 E 之前的原本不发音的字母需要发音,例如 porte 中的 T 原本不发音,但因为 E 的存在,T 需要发音 +4. 复数形式动词末尾的 -ENT + - 如:parlent、mangent、choisissent + +[联诵](/cards/liaison/)(liaison)会激活原本不发音的辅音。 + +Source: [YouTube](https://www.youtube.com/watch?v=sSCEoAWw0q4) \ No newline at end of file -- cgit v1.2.3 From 858ccf423c85a523cc1b36b3cb4756216d066976 Mon Sep 17 00:00:00 2001 From: Eltrac Date: Fri, 6 Jun 2025 11:49:36 +0800 Subject: docs: weekly draft Former-commit-id: 6ae89f30cf991767258859e592de81b0a07cb93f --- content/posts/weekly/32.md | 90 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 content/posts/weekly/32.md diff --git a/content/posts/weekly/32.md b/content/posts/weekly/32.md new file mode 100644 index 00000000..42b4e2b6 --- /dev/null +++ b/content/posts/weekly/32.md @@ -0,0 +1,90 @@ +--- +title: 稻草人周刊 Vol.32 +subtitle: +tags: +date: 2025-06-06 11:20:42 +categories: 稻草人周刊 +banner: +draft: true +toc: true +hasAplayer: true +related_cards: + - 图灵机和可计算性理论 + - 法语中不发音的字母 + - liaison +endnotes: + - 封面图自摄,设备为 iPhone 15 Pro +aplayer: true + +--- + + + +{{< aplayer name="Waves" artist="Chloe Moriondo, Eltrac" url="https://image.guhub.cn/uPic/20250602-waves.mp3" cover="https://image.guhub.cn//uPic/waves-cover.png" >}} + +## 🙋 在做什么 + +## 💬 本期杂谈 + +### 「无人在意」时代 + +{{< callout "文章链接:[The Who Cares Era](https://dansinker.com/posts/2025-05-23-who-cares/)" "📜" >}} + +最近,美国的两家纸质媒体在自家的增刊上填入了大量 AI 生成的垃圾,其中的「夏日导读」栏目列出的 15 本书中,居然有 10 本书的书名和作者全是 AI 捏造的。这一新闻让作者感到最愤慨的不是报纸也用 AI 敷衍了事的行为,而是在这整个过程中——**没有一个人在乎**。 + +> The writer didn't care. The supplement's editors didn't care. The biz people on both sides of the sale of the supplement didn't care. The production people didn't care. And, the fact that it took *two days* for anyone to discover this epic fuckup in print means that, ultimately, the reader didn't care either. +> +> 作者不在乎。增刊的编辑不在乎。销售两边的业务人员也不在乎。制作人员不在乎。而且,过了**两天**才有人发现这个天大的失误,事实证明,最终,读者其实也不在乎。 + +作者认为,AI 生成的作品对大多数人来说都足够好了(good enough),因为大多数人根本就不在乎。作者从自己录制播客的经历中感受到,他们做出来的东西最终都会成为这样的存在: + +> Some dude talking to some other dude about apps that some third dude would half-listen to at 2x speed while texting a fourth dude about plans for later. +> +> 某个人跟另一个人讨论应用程序,只是为了让第三个人漫不经心地开着二倍速听着,一边还和第四个人发短信讨论接下来的安排。 + +一些内容就是为了被消费而创造的。 + +作者在阅读一些申请书的时候也发现了大量的 AI 痕迹,这让他感到厌烦。在机器吐出来的文字之间,当他终于发现一个完全由人类写出来的申请书时,他觉得那些字发出了令人愉悦但同时又略带忧伤的光芒,并且每一次转折都令人难以预料。 + +那是人类的文字,由真正在乎的人书写。 + +在「无人在意」时代,你能做的最叛逆的事情就是:做自己,变得不完美,当好一个人类,**去在乎**。 + +[#创作](/tags/创作/) [#AI](/tags/AI/) [#消费主义](/tags/消费主义/) [#互联网文化](/tags/互联网文化/) + +### 光盘是一种可靠的存储介质 + +{{< callout "文章链接:[The Reliability of Optical Disks](https://blog.ligos.net/2022-04-02/The-Reliability-Of-Optical-Disks.html))" "📜" >}} + +作者表示他有大量的长时间不需要读取,但需要保留的数据。尽管比机械硬盘还要贵一些,但他选择了光盘作为这些数据的存储介质,原因是: + +1. 只要避免阳光直射,光盘里的数据就能储存十多年的时间,不需要像硬盘那样较频繁地维护。 +2. 光盘是完全离线的物理介质,一般没有人会把它连接到服务器上;既然不连接到云端,数据的安全性就得到了非常可靠的保障,就像写在纸上一样(只要没人偷走你的光盘)。 + +当然,光盘也有很多问题,比如读取速度慢、容量较小、需要额外的目录应用来快速找到光盘中存储的文件,而且光盘更贵,还不是如今的主流存储介质,要买到相关设备可能没那么方便。 + +不过,作者仍然认为光盘是进行长期数据存储的可选方案,任何人需要离线、防勒索、20 年以上备份的,都应该考虑光盘。作者最推荐的光盘是 BluRay M-Disc。 + +### 如何对抗失序? + +{{< callout "播客链接:[Apple Podcast](https://podcasts.apple.com/cn/podcast/%E7%8B%AC%E6%A0%91%E4%B8%8D%E6%88%90%E6%9E%97/id1711052890?i=1000710489598) / [小宇宙](https://www.xiaoyuzhoufm.com/episode/6837f04c38dcc57c648c8b97?utm_source=rss)" "📻" >}} + +![image-20250606114710105](https://image.guhub.cn/uPic/2025/06/image-20250606114710105.png) + +耕种自己的花园,接受失序是生命的常态。 + +…… + +### + +## 💡 新知复盘 + +{{< card "图灵机和可计算性理论" >}} + +{{< card "法语中不发音的字母" >}} + +{{< card "liaison" >}} + +## 🗣️ 碎碎念 + +- \ No newline at end of file -- cgit v1.2.3 From d92cd95ca741d15e7dbaf23a8f4432fd5c8891f0 Mon Sep 17 00:00:00 2001 From: Eltrac Date: Fri, 6 Jun 2025 14:25:01 +0800 Subject: refactor: simplify fuzzy time algorithm Use a dict instead of lots of ifs Former-commit-id: d7216ab0f13c9fc050e1c137c99ce62ed2cbdb55 --- layouts/posts/single.html | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/layouts/posts/single.html b/layouts/posts/single.html index dd6d4b8b..71716a82 100644 --- a/layouts/posts/single.html +++ b/layouts/posts/single.html @@ -17,25 +17,23 @@ diff --git a/layouts/partials/components/banner.html b/layouts/partials/components/banner.html index e14572f4..7ab4c826 100644 --- a/layouts/partials/components/banner.html +++ b/layouts/partials/components/banner.html @@ -2,6 +2,7 @@
      -- cgit v1.2.3 From 9855baa4d1dea96fc4516283bf66a98f10a29eaa Mon Sep 17 00:00:00 2001 From: Eltrac Date: Fri, 6 Jun 2025 14:53:45 +0800 Subject: refactor: reuse some page components Former-commit-id: ed5fe0848d18665cd3fbd6011876207b2fee61e4 --- layouts/fictions/single.html | 11 +--- layouts/library/single.html | 7 ++- layouts/partials/components/category-pill.html | 8 +++ layouts/partials/components/date.html | 26 +++++++++ layouts/partials/components/endnotes.html | 10 ++++ layouts/partials/components/now-read-this.html | 19 +++++++ layouts/partials/components/toc.html | 2 + layouts/posts/single.html | 73 +++----------------------- 8 files changed, 77 insertions(+), 79 deletions(-) create mode 100644 layouts/partials/components/category-pill.html create mode 100644 layouts/partials/components/date.html create mode 100644 layouts/partials/components/endnotes.html create mode 100644 layouts/partials/components/now-read-this.html diff --git a/layouts/fictions/single.html b/layouts/fictions/single.html index e16dd4c7..83db7d60 100644 --- a/layouts/fictions/single.html +++ b/layouts/fictions/single.html @@ -11,16 +11,7 @@ > {{ partial "components/banner.html" . }}

      {{ .Title }}

      - + diff --git a/layouts/library/single.html b/layouts/library/single.html index d0dbf542..861cee24 100644 --- a/layouts/library/single.html +++ b/layouts/library/single.html @@ -35,11 +35,10 @@
      {{ .Content }}
      + + {{ partial "components/endnotes" . }}
    {{ partial "components/comment.html" . }} diff --git a/layouts/partials/components/category-pill.html b/layouts/partials/components/category-pill.html new file mode 100644 index 00000000..aeb25747 --- /dev/null +++ b/layouts/partials/components/category-pill.html @@ -0,0 +1,8 @@ +{{ with .GetTerms "categories" }} + {{ with index . 0 }} + + {{ end }} +{{ end }} diff --git a/layouts/partials/components/date.html b/layouts/partials/components/date.html new file mode 100644 index 00000000..1998202f --- /dev/null +++ b/layouts/partials/components/date.html @@ -0,0 +1,26 @@ +{{ if .Date }} + {{ $hour := .Date.Hour }} + {{ $fuzzyTimes := slice + (dict "limit" 5 "label" "凌晨") + (dict "limit" 7 "label" "清晨") + (dict "limit" 11 "label" "早上") + (dict "limit" 13 "label" "中午") + (dict "limit" 17 "label" "下午") + (dict "limit" 19 "label" "傍晚") + (dict "limit" 22 "label" "晚上") + }} + {{ $fuzzyTime := "深夜" }} {{/* default */}} + {{ range $fuzzyTimes }} + {{ if lt $hour .limit }} + {{ $fuzzyTime = .label }} + {{ break }} + {{ end }} + {{ end }} + + +{{ end }} diff --git a/layouts/partials/components/endnotes.html b/layouts/partials/components/endnotes.html new file mode 100644 index 00000000..e7245ad4 --- /dev/null +++ b/layouts/partials/components/endnotes.html @@ -0,0 +1,10 @@ +{{ if .Params.endnotes }} +
    +
    +
      + {{ range .Params.endnotes }} +
    • {{ . | markdownify }}
    • + {{ end }} +
    +
    +{{ end }} diff --git a/layouts/partials/components/now-read-this.html b/layouts/partials/components/now-read-this.html new file mode 100644 index 00000000..6f2950c2 --- /dev/null +++ b/layouts/partials/components/now-read-this.html @@ -0,0 +1,19 @@ +{{ with site.RegularPages.Related . | first 1 }} +
    +

    {{ T "nowReadThis" }}

    + {{ range . }} + +
    +

    {{ .Summary | plainify }}

    +
    + {{ end }} +
    +{{ end }} diff --git a/layouts/partials/components/toc.html b/layouts/partials/components/toc.html index eb75badd..794328c9 100644 --- a/layouts/partials/components/toc.html +++ b/layouts/partials/components/toc.html @@ -1,3 +1,4 @@ +{{ if .Params.toc }}
    {{ .TableOfContents }}
    + +{{/* Group word counts per month */}} +{{ $monthly := dict }} +{{ range .Site.RegularPages }} + {{ $month := .Date.Format "2006-01" }} + {{ $count := .WordCount }} + {{ with index $monthly $month }} + {{ $monthly = merge $monthly (dict $month (add . $count)) }} + {{ else }} + {{ $monthly = merge $monthly (dict $month $count) }} + {{ end }} +{{ end }} + +{{/* Sort months */}} +{{ $months := slice }} +{{ range $month, $_ := $monthly }} + {{ $months = $months | append $month }} +{{ end }} +{{ $months = sort $months }} + +{{/* Find max value */}} +{{ $max := 0 }} +{{ range $month := $months }} + {{ $val := index $monthly $month }} + {{ if gt $val $max }}{{ $max = $val }}{{ end }} +{{ end }} + +
    + {{ range $month := $months }} + {{ $val := index $monthly $month }} + {{ $height := mul (div (float $val) (float $max)) 100 }} + {{ $opacity := add 0.5 (div $height 200) }} +
    +
    +
    {{ $val }}
    +
    +
    +
    {{ $month }}
    +
    + {{ end }} +
    diff --git a/layouts/partials/components/wordCountChart.html b/layouts/partials/components/wordCountChart.html deleted file mode 100644 index 65d0e986..00000000 --- a/layouts/partials/components/wordCountChart.html +++ /dev/null @@ -1,93 +0,0 @@ - - -{{/* Group word counts per month */}} -{{ $monthly := dict }} -{{ range .Site.RegularPages }} - {{ $month := .Date.Format "2006-01" }} - {{ $count := .WordCount }} - {{ with index $monthly $month }} - {{ $monthly = merge $monthly (dict $month (add . $count)) }} - {{ else }} - {{ $monthly = merge $monthly (dict $month $count) }} - {{ end }} -{{ end }} - -{{/* Sort months */}} -{{ $months := slice }} -{{ range $month, $_ := $monthly }} - {{ $months = $months | append $month }} -{{ end }} -{{ $months = sort $months }} - -{{/* Find max value */}} -{{ $max := 0 }} -{{ range $month := $months }} - {{ $val := index $monthly $month }} - {{ if gt $val $max }}{{ $max = $val }}{{ end }} -{{ end }} - -
    - {{ range $month := $months }} - {{ $val := index $monthly $month }} - {{ $height := mul (div (float $val) (float $max)) 100 }} - {{ $opacity := add 0.5 (div $height 200) }} -
    -
    -
    {{ $val }}
    -
    -
    -
    {{ $month }}
    -
    - {{ end }} -
    -- cgit v1.2.3 From 0ac60ffa01936c75d31541f03552fe089fd0b406 Mon Sep 17 00:00:00 2001 From: Eltrac Date: Fri, 6 Jun 2025 15:06:53 +0800 Subject: feat: open first 3 months' post list instead of just 1 Former-commit-id: f13361b6122cda0f8a0e9b2e59341164c5324715 --- layouts/_default/section.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/layouts/_default/section.html b/layouts/_default/section.html index c725fcaa..c051990e 100644 --- a/layouts/_default/section.html +++ b/layouts/_default/section.html @@ -3,7 +3,7 @@ {{ partial "header.html" . }}
    - {{ $first := true }} + {{ $remainingMonthsToOpen := 3 }} {{ range (where site.RegularPages "Type" "eq" "posts").GroupByDate "2006" -}}

    @@ -11,8 +11,8 @@ {{ T "archivePage.postCountAnnual" (len .Pages) }}

    - {{ range .Pages.GroupByDate "January" }} -
    + {{ range .Pages.GroupByDate "January" }} +

    {{ .Key }} @@ -43,7 +43,7 @@

    - {{ $first = false }} + {{ $remainingMonthsToOpen = sub $remainingMonthsToOpen 1 }} {{ end }} {{ end }} -- cgit v1.2.3 From a0ae7e4ae6af6380ae97d648f7966c54a550b17c Mon Sep 17 00:00:00 2001 From: Eltrac Date: Fri, 6 Jun 2025 15:24:09 +0800 Subject: refactor: reuse card items Former-commit-id: b33acb90cc9c4eed5c442e1b2dbc2525211f5606 --- assets/css/components/_card.scss | 4 ++++ layouts/cards/section.html | 20 +------------------- layouts/cards/single.html | 23 +---------------------- layouts/index.html | 27 ++------------------------- layouts/partials/items/card.html | 24 ++++++++++++++++++++++++ 5 files changed, 32 insertions(+), 66 deletions(-) create mode 100644 layouts/partials/items/card.html diff --git a/assets/css/components/_card.scss b/assets/css/components/_card.scss index 491604b6..8e03cc1d 100644 --- a/assets/css/components/_card.scss +++ b/assets/css/components/_card.scss @@ -25,6 +25,10 @@ .card-title { margin: 0; + a { + text-decoration: none; + color: inherit; + } } .card-content { diff --git a/layouts/cards/section.html b/layouts/cards/section.html index 7e24facc..4ec8f4ee 100644 --- a/layouts/cards/section.html +++ b/layouts/cards/section.html @@ -5,25 +5,7 @@ {{- $cards := .Site.GetPage "section" "cards" }} {{- $paginator := .Paginate $cards.Pages 10 }} {{- range $paginator.Pages }} -
    -
    -

    - {{ .Title }} -

    - {{- if .Params.tags }} -

    - {{- range .Params.tags }} - #{{ . }} - {{- end }} -

    - {{- end }} -
    - -
    - {{ .Summary }} -
    -
    + {{ partial "items/card" (dict "context" . "summary" true) }} {{- end }} diff --git a/layouts/cards/single.html b/layouts/cards/single.html index d75d1ffa..846f985b 100644 --- a/layouts/cards/single.html +++ b/layouts/cards/single.html @@ -7,28 +7,7 @@ style="view-transition-name: title-image" /> -
    -
    -

    - {{ .Title }} -

    - {{- if .Params.tags }} -

    - {{- range .Params.tags }} - #{{ . }} - {{- end }} -

    - {{- end }} -
    -
    - {{ .Content }} -
    -
    + {{ partial "items/card" (dict "context" .) }} {{- /* 查询引用了这个卡片的文章 */ -}} {{- $currentCard := .File.BaseFileName -}} diff --git a/layouts/index.html b/layouts/index.html index 1074574f..cc1042fd 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -13,9 +13,7 @@

    - + in {{ .Section }}

    {{- $paginator := .Paginate $cards.Pages 4 }} {{- range $paginator.Pages }} -
    -
    -

    - {{ .Title }} -

    - {{- if .Params.tags }} -

    - {{- range .Params.tags }} - #{{ . }} - {{- end }} -

    - {{- end }} -
    - -
    - {{ .Summary }} -
    -
    + {{ partial "items/card" (dict "context" . "summary" true) }} {{- end }}

    diff --git a/layouts/partials/items/card.html b/layouts/partials/items/card.html new file mode 100644 index 00000000..011d78fa --- /dev/null +++ b/layouts/partials/items/card.html @@ -0,0 +1,24 @@ +{{ $ctx := .context }} +{{ $showSummary := .summary }} +
    +
    +

    + {{ $ctx.Title }} +

    + {{- if $ctx.Params.tags }} +

    + {{- range $ctx.Params.tags }} + #{{ . }} + {{- end }} +

    + {{- end }} +
    +
    + {{ if $showSummary }}{{ $ctx.Summary }}{{ else }}{{ $ctx.Content }}{{ end }} +
    +
    -- cgit v1.2.3 From 25d371432953e87e61f68901201c53ebf7ebce63 Mon Sep 17 00:00:00 2001 From: Eltrac Date: Fri, 6 Jun 2025 15:24:23 +0800 Subject: docs: add more tag to long card Former-commit-id: 7e04c02e0c42a53fef11a19f528514ef2746710d --- ...15\345\217\221\351\237\263\347\232\204\345\255\227\346\257\215.md" | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git "a/content/cards/\346\263\225\350\257\255\344\270\255\344\270\215\345\217\221\351\237\263\347\232\204\345\255\227\346\257\215.md" "b/content/cards/\346\263\225\350\257\255\344\270\255\344\270\215\345\217\221\351\237\263\347\232\204\345\255\227\346\257\215.md" index 7922ad6e..5a491680 100644 --- "a/content/cards/\346\263\225\350\257\255\344\270\255\344\270\215\345\217\221\351\237\263\347\232\204\345\255\227\346\257\215.md" +++ "b/content/cards/\346\263\225\350\257\255\344\270\255\344\270\215\345\217\221\351\237\263\347\232\204\345\255\227\346\257\215.md" @@ -11,7 +11,7 @@ Les lettres muettes: 1. 单词末尾的 P、D、T、S、X 和 Z - 如:froid、trois、petit、deux 2. 复数形式单词末尾的 S 和 X - - 如:châteaux、étoiles、voitures + - 如:châteaux、étoiles、voitures 3. 单词末尾的 E - 如:table、pomme、robe、**porte**、vie - 值得注意的是,在末尾有 E 的情况下,在 E 之前的原本不发音的字母需要发音,例如 porte 中的 T 原本不发音,但因为 E 的存在,T 需要发音 @@ -20,4 +20,4 @@ Les lettres muettes: [联诵](/cards/liaison/)(liaison)会激活原本不发音的辅音。 -Source: [YouTube](https://www.youtube.com/watch?v=sSCEoAWw0q4) \ No newline at end of file +Source: [YouTube](https://www.youtube.com/watch?v=sSCEoAWw0q4) -- cgit v1.2.3 From 279e6b2d33d2ca20777f9affd8c7cfe2b9ca228b Mon Sep 17 00:00:00 2001 From: Eltrac Date: Fri, 6 Jun 2025 15:25:46 +0800 Subject: remove: unnatural active icon link style Former-commit-id: a64a39181cc216c41b8b3b0ed6267b25d27e2027 --- assets/css/components/_postlist.scss | 4 ---- 1 file changed, 4 deletions(-) diff --git a/assets/css/components/_postlist.scss b/assets/css/components/_postlist.scss index 022f97bd..171f2367 100644 --- a/assets/css/components/_postlist.scss +++ b/assets/css/components/_postlist.scss @@ -102,10 +102,6 @@ &.active .icon-link { opacity: 1; } - &.active .icon-link { - display: inline-block; - transform: scale(1.1) rotate(90deg); - } } #search-instruction { -- cgit v1.2.3 From fa48f611d0de8cbe389268ae3f356f307b6a4970 Mon Sep 17 00:00:00 2001 From: Eltrac Date: Fri, 6 Jun 2025 16:00:30 +0800 Subject: feat: brand new linkroll page (originally blogroll) Former-commit-id: 1de3fcd5b70746251b37f711e999c21f02f4b51d --- assets/css/components/_shortcodes.scss | 66 ++++++++++++++++++++++++++++++++++ config/_default/languages.yaml | 4 +-- content/blogroll.md | 38 -------------------- content/linkroll.md | 45 +++++++++++++++++++++++ layouts/shortcodes/link.html | 14 ++++++++ 5 files changed, 127 insertions(+), 40 deletions(-) delete mode 100644 content/blogroll.md create mode 100644 content/linkroll.md create mode 100644 layouts/shortcodes/link.html diff --git a/assets/css/components/_shortcodes.scss b/assets/css/components/_shortcodes.scss index 52de0999..934417d3 100644 --- a/assets/css/components/_shortcodes.scss +++ b/assets/css/components/_shortcodes.scss @@ -137,3 +137,69 @@ .sidenote-content { font-size: 1rem } + +/* blog links */ + +.linkroll { + display: flex; + flex-wrap: wrap; + gap: 1rem; +} + +a.blog-link { + position: relative; + background-color: var(--block-background-color); + text-decoration: none; + color: var(--text-color); + padding: 1rem 2rem; + padding-right: 4rem; + border-radius: 1rem; + width: calc(50% - 2rem); + box-sizing: border-box; + overflow: hidden; + + h4, p { + margin: 0; + font-size: 1.2rem; + } + + p { + line-height: 1.5; + } + + .link-content { + z-index: 10; + } + + img { + --size: 5rem; + display: block; + position: absolute; + right: -1rem; + bottom: -1rem; + width: var(--size); + height: var(--size); + border-radius: 100%; + z-index: 0; + } +} + +@media screen and (max-width: 768px) { + a.blog-link { + font-size: 1.2rem; + padding: 0.5rem 1rem; + padding-right: 2rem; + width: 100%; + } +} + +a.podcast-link { + text-decoration: none; + color: inherit; + width: calc(25% - 1rem); + .link-image { + overflow: hidden; + border-radius: 5px; + img { margin: 0 } + } +} diff --git a/config/_default/languages.yaml b/config/_default/languages.yaml index c6de1f86..67d79a52 100644 --- a/config/_default/languages.yaml +++ b/config/_default/languages.yaml @@ -37,8 +37,8 @@ zh: cover: https://image.guhub.cn/uPic/2025/01/%E7%A8%BB%E8%8D%89%E4%BA%BA%E5%91%A8%E5%88%8A.jpeg description: 个人化的信息整合,每周一更新 footerInternalLinks: - - name: 波卷 - link: /blogroll/ + - name: 林卷 + link: /linkroll/ - name: 赞助 link: /sponsor/ title: 極客死亡計劃 diff --git a/content/blogroll.md b/content/blogroll.md deleted file mode 100644 index 0883a5e4..00000000 --- a/content/blogroll.md +++ /dev/null @@ -1,38 +0,0 @@ ---- -date: 2025-05-06 11:12:12 -title: 博客志 -aliases: - - /cards/links/ - - /links/ ---- - -## 我常逛的中文博客 - -- [Velas 电波站](https://www.velasx.com/) -- [白洛嘉](https://brocalife.com/) -- [莫比乌斯](https://onojyun.com/) -- [白熊阿丸的小屋](https://blog.bxaw.name/) -- [CC 的数字花园](https://cyrus19.cc/) -- [dyron503's](https://career.dyron503.top/) -- [非理勿试](https://www.ntiy.com/) -- [查令十字街 84 号](https://www.javis.me/) -- [Owen 的博客](https://www.owenyoung.com/) -- [SkyWT](https://skywt.cn/) -- [LCZBlog](https://blog.licaoz.com/) -- [2750 words](https://pathos.page/) -- [园子里的日光](https://chlor.me/) -- [Limboy's HQ](https://limboy.me/) -- [Nelson Boss](https://nelsonboss.ink/) -- [Randy's Blog](https://lutaonan.com/) -- [Taxodium](https://taxodium.ink/) - -## 我常听的中文播客 - -- [独树不成林](https://podcasts.apple.com/cn/podcast/%E7%8B%AC%E6%A0%91%E4%B8%8D%E6%88%90%E6%9E%97/id1711052890) -- [碳基生物生存指南](https://podcasts.apple.com/cn/podcast/%E7%A2%B3%E5%9F%BA%E7%94%9F%E7%89%A9%E7%94%9F%E5%AD%98%E6%8C%87%E5%8D%97/id1707385930) -- [没理想编辑部](https://podcasts.apple.com/cn/podcast/%E6%B2%A1%E7%90%86%E6%83%B3%E7%BC%96%E8%BE%91%E9%83%A8/id1494093522) -- [狐说巴道烫](https://podcasts.apple.com/cn/podcast/%E7%8B%90%E8%AF%B4%E5%B7%B4%E9%81%93%E7%83%AB/id1785346634) - ---- - -Check out some cool English sites [here](/en/blogroll). diff --git a/content/linkroll.md b/content/linkroll.md new file mode 100644 index 00000000..1390ad37 --- /dev/null +++ b/content/linkroll.md @@ -0,0 +1,45 @@ +--- +date: 2025-05-06 11:12:12 +title: 林卷 +aliases: + - /cards/links/ + - /links/ + - /blogroll/ +--- + +「林卷」是 Linkroll 的半音译,受到了 [Hsins](https://hsins.me/) 的启发,他把 Blogroll 译作「波卷」。这个页面收录我常看的链接,包括一些博客、播客和有意思的网站,由于内容不限于博客,所以取名 Linkroll。 + +## 我常读的中文博客 + +
    +{{< link link="https://www.velasx.com/" title="Velas 电波站" >}} +{{< link link="https://brocalife.com/" title="白洛嘉" >}} +{{< link link="https://onojyun.com/" title="莫比乌斯" >}} +{{< link link="https://blog.bxaw.name/" title="白熊阿丸的小屋" >}} +{{< link link="https://cyrus19.cc/" title="CC 的数字花园" >}} +{{< link link="https://career.dyron503.top/" title="dyron503's" >}} +{{< link link="https://www.ntiy.com/" title="非理勿试" >}} +{{< link link="https://www.javis.me/" title="查令十字街 84 号" >}} +{{< link link="https://owenyoung.com/" title="Owen 的博客" >}} +{{< link link="https://skywt.cn/" title="SkyWT" >}} +{{< link link="https://blog.licaoz.com/" title="LCZBlog" >}} +{{< link link="https://pathos.page/" title="2750 words" >}} +{{< link link="https://chlor.me/" title="园子里的日光" >}} +{{< link link="https://limboy.me/" title="Limboy's HQ" >}} +{{< link link="https://nelsonboss.ink/" title="Nelson Boss" >}} +{{< link link="https://lutaonan.com/" title="Randy's Blog" >}} +{{< link link="https://taxodium.ink/" title="Taxodium" >}} +
    + +## 我常听的中文播客 + +
    +{{< link type="podcast" title="独树不成林" link="https://podcasts.apple.com/cn/podcast/%E7%8B%AC%E6%A0%91%E4%B8%8D%E6%88%90%E6%9E%97/id1711052890" image="https://image.guhub.cn/uPic/2025/06/Fp3PROfjHhWN5OjBQf6Y8lUh3KkB.png@small.png" >}} +{{< link type="podcast" title="碳基生物生存指南" link="https://podcasts.apple.com/cn/podcast/%E7%A2%B3%E5%9F%BA%E7%94%9F%E7%89%A9%E7%94%9F%E5%AD%98%E6%8C%87%E5%8D%97/id1707385930" image="https://image.guhub.cn/uPic/2025/06/Fj8-4YU1LHRuvPF76MLRlxPjzOON.png@small.png" >}} +{{< link type="podcast" title="没理想编辑部" link="https://podcasts.apple.com/cn/podcast/%E6%B2%A1%E7%90%86%E6%83%B3%E7%BC%96%E8%BE%91%E9%83%A8/id1494093522" image="https://image.guhub.cn/uPic/2025/06/aHR0cHM6Ly9jZG4udmlzdG9waWEuY29tLmNuL2ltZy9wb2RjYXN0LW1seGZtLXYxLmpwZw==.jpg@small.jpeg" >}} +{{< link type="podcast" title="狐说巴道烫" link="https://podcasts.apple.com/cn/podcast/%E7%8B%90%E8%AF%B4%E5%B7%B4%E9%81%93%E7%83%AB/id1785346634" image="https://image.guhub.cn/uPic/2025/06/FgcvRTuBSvcaed0fE05NJfm7RElV.jpg@small.jpeg" >}} +
    + +--- + +Check out some cool English sites [here](/en/blogroll). diff --git a/layouts/shortcodes/link.html b/layouts/shortcodes/link.html new file mode 100644 index 00000000..1b9c4f79 --- /dev/null +++ b/layouts/shortcodes/link.html @@ -0,0 +1,14 @@ + + {{ if and (isset .Params "image") .Params.image }} + + {{ end }} + {{ if ne (.Get "type") "podcast" }} + + {{ end }} + -- cgit v1.2.3 From e954f0d0560f36948fb123539629085f128f64e8 Mon Sep 17 00:00:00 2001 From: Eltrac Date: Fri, 6 Jun 2025 16:08:37 +0800 Subject: refactor: reuse tag list Former-commit-id: 17cc7da7218f24775bcdcbd1631c1d9380492d1d --- assets/css/components/_post.scss | 2 +- assets/css/components/_postlist.scss | 2 +- layouts/_default/featured.html | 8 ++------ layouts/partials/components/tags.html | 3 +++ layouts/partials/items/card.html | 8 +------- layouts/posts/single.html | 4 +--- 6 files changed, 9 insertions(+), 18 deletions(-) create mode 100644 layouts/partials/components/tags.html diff --git a/assets/css/components/_post.scss b/assets/css/components/_post.scss index 8f937d11..798fd665 100644 --- a/assets/css/components/_post.scss +++ b/assets/css/components/_post.scss @@ -24,7 +24,7 @@ gap: 0.5rem; align-items: center; - .post-date, .post-tag { + .post-date, .tag { color: var(--secondary-text-color) } diff --git a/assets/css/components/_postlist.scss b/assets/css/components/_postlist.scss index 171f2367..57c6b18f 100644 --- a/assets/css/components/_postlist.scss +++ b/assets/css/components/_postlist.scss @@ -31,7 +31,7 @@ time { font-family: var(--mono-font-family); } - a.post-tag { + a.tag { font-size: 0.8rem; color: var(--secondary-text-color); } diff --git a/layouts/_default/featured.html b/layouts/_default/featured.html index 8b599d27..86d5f53a 100644 --- a/layouts/_default/featured.html +++ b/layouts/_default/featured.html @@ -16,13 +16,9 @@

    - + · - {{ range .Params.tags }} - - {{ end }} + {{ partial "components/tags" . }}

    #{{ . }} +{{ end }} diff --git a/layouts/partials/items/card.html b/layouts/partials/items/card.html index 011d78fa..b8a3c7c1 100644 --- a/layouts/partials/items/card.html +++ b/layouts/partials/items/card.html @@ -10,13 +10,7 @@ data-weight="5"> {{ $ctx.Title }}

    - {{- if $ctx.Params.tags }} -

    - {{- range $ctx.Params.tags }} - #{{ . }} - {{- end }} -

    - {{- end }} +
    {{ partial "components/tags" $ctx }}
    {{ if $showSummary }}{{ $ctx.Summary }}{{ else }}{{ $ctx.Content }}{{ end }} diff --git a/layouts/posts/single.html b/layouts/posts/single.html index 86d595d6..7a7051f0 100644 --- a/layouts/posts/single.html +++ b/layouts/posts/single.html @@ -19,9 +19,7 @@ {{ partial "components/date" . }} {{ if or .Params.categories .Params.tags }}·{{ end }} {{ partial "components/category-pill" . }} - {{ range .Params.tags }} - - {{ end }} + {{ partial "components/tags" . }}
    -- cgit v1.2.3 From d9576c8e47f0f98ce175fc57590d33d04babc7b6 Mon Sep 17 00:00:00 2001 From: Eltrac Date: Fri, 6 Jun 2025 16:50:39 +0800 Subject: refactor: reuse title-image (logo.html) Former-commit-id: 83e93e66caf86656b37659ac5ee60d3e840d19dd --- config/_default/params.yaml | 2 -- layouts/cards/single.html | 8 +------- layouts/library/single.html | 8 +------- layouts/partials/components/logo.html | 10 ++++++++++ layouts/partials/components/post-page-header.html | 12 +++++------- layouts/partials/header.html | 7 +------ 6 files changed, 18 insertions(+), 29 deletions(-) create mode 100644 layouts/partials/components/logo.html diff --git a/config/_default/params.yaml b/config/_default/params.yaml index 5314fee8..7eb983ca 100644 --- a/config/_default/params.yaml +++ b/config/_default/params.yaml @@ -30,5 +30,3 @@ giscus: emitMetadata: 0 inputPosition: top theme: "https://www.geedea.pro/css/giscus_noborder.css" -images: - header: https://image.guhub.cn/uPic/2025/05/header.png diff --git a/layouts/cards/single.html b/layouts/cards/single.html index 846f985b..0b269bca 100644 --- a/layouts/cards/single.html +++ b/layouts/cards/single.html @@ -1,12 +1,6 @@ {{ define "main" }}
    - - Logo - + {{ partial "components/logo" (dict "link" "cards") }} {{ partial "items/card" (dict "context" .) }} {{- /* 查询引用了这个卡片的文章 */ -}} diff --git a/layouts/library/single.html b/layouts/library/single.html index 861cee24..1f051da7 100644 --- a/layouts/library/single.html +++ b/layouts/library/single.html @@ -22,13 +22,7 @@

    - - Logo - + {{ partial "components/logo" (dict "link" "library") }}
    diff --git a/layouts/partials/components/logo.html b/layouts/partials/components/logo.html new file mode 100644 index 00000000..36040768 --- /dev/null +++ b/layouts/partials/components/logo.html @@ -0,0 +1,10 @@ +{{ $default := "https://image.guhub.cn/uPic/2025/05/header.png" }} +{{ $link := .link | default "" }} +{{ $src := .src | default $default }} + + + Logo + diff --git a/layouts/partials/components/post-page-header.html b/layouts/partials/components/post-page-header.html index 3c572b45..4363b74c 100644 --- a/layouts/partials/components/post-page-header.html +++ b/layouts/partials/components/post-page-header.html @@ -1,10 +1,8 @@
    - - Logo - + {{ if eq .Section "fictions" }} + {{ partial "components/logo" (dict "src" "/img/potted-skeleton.svg" "link" "fictions") }} + {{ else }} + {{ partial "components/logo" }} + {{ end }}
    diff --git a/layouts/partials/header.html b/layouts/partials/header.html index 8213690a..214552d6 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -1,12 +1,7 @@