summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEltrac <hi@guhub.cn>2025-06-07 02:50:09 +0800
committerEltrac <hi@guhub.cn>2025-06-07 02:50:09 +0800
commitf8f728edbfeecdfeb5e7b3f61994af6028a01680 (patch)
treec26c78a7ebbbd86b3312627a431e95545a367a69
parent0660eba2d965e07e72496616ff3527aa6d2dd506 (diff)
parent2108c84a3efdbd1d0583283fa53bc9851e3a5e63 (diff)
Merge branch 'master' of https://github.com/BigCoke233/geek-death-project
Former-commit-id: 92b9414863c95a4b034ca2687ab326484af52496
-rw-r--r--assets/css/components/_card.scss4
-rw-r--r--assets/css/components/_post.scss2
-rw-r--r--assets/css/components/_postlist.scss6
-rw-r--r--assets/css/components/_shortcodes.scss66
-rw-r--r--config/_default/languages.yaml4
-rw-r--r--config/_default/params.yaml2
-rw-r--r--content/blogroll.md38
-rw-r--r--content/cards/liaison.md17
-rw-r--r--content/cards/图灵机和可计算性理论.md (renamed from content/图灵机和可计算性理论.md)0
-rw-r--r--content/cards/法语中不发音的字母.md23
-rw-r--r--content/linkroll.md45
-rw-r--r--content/posts/weekly/31.md10
-rw-r--r--content/posts/weekly/32.md110
-rw-r--r--layouts/_default/featured.html10
-rw-r--r--layouts/_default/section.html9
-rw-r--r--layouts/_default/stats.html3
-rw-r--r--layouts/_default/uncategorized.html2
-rw-r--r--layouts/cards/section.html20
-rw-r--r--layouts/cards/single.html31
-rw-r--r--layouts/categories/taxonomy.html2
-rw-r--r--layouts/categories/term.html2
-rw-r--r--layouts/fictions/single.html11
-rw-r--r--layouts/index.html33
-rw-r--r--layouts/library/single.html16
-rw-r--r--layouts/partials/components/banner.html1
-rw-r--r--layouts/partials/components/category-pill.html8
-rw-r--r--layouts/partials/components/comment.html5
-rw-r--r--layouts/partials/components/date.html26
-rw-r--r--layouts/partials/components/endnotes.html10
-rw-r--r--layouts/partials/components/global-search.html2
-rw-r--r--layouts/partials/components/logo.html10
-rw-r--r--layouts/partials/components/now-read-this.html19
-rw-r--r--layouts/partials/components/post-page-header.html12
-rw-r--r--layouts/partials/components/postnav.html11
-rw-r--r--layouts/partials/components/tags.html3
-rw-r--r--layouts/partials/components/toc.html2
-rw-r--r--layouts/partials/components/word-count-chart.html (renamed from layouts/partials/components/wordCountChart.html)0
-rw-r--r--layouts/partials/header.html11
-rw-r--r--layouts/partials/items/card.html18
-rw-r--r--layouts/posts/single.html79
-rw-r--r--layouts/shortcodes/link.html14
-rw-r--r--layouts/term/term.html4
42 files changed, 442 insertions, 259 deletions
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/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 022f97bd..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);
}
@@ -102,10 +102,6 @@
&.active .icon-link {
opacity: 1;
}
- &.active .icon-link {
- display: inline-block;
- transform: scale(1.1) rotate(90deg);
- }
}
#search-instruction {
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/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/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/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/图灵机和可计算性理论.md b/content/cards/图灵机和可计算性理论.md
index 86bf99a0..86bf99a0 100644
--- a/content/图灵机和可计算性理论.md
+++ b/content/cards/图灵机和可计算性理论.md
diff --git a/content/cards/法语中不发音的字母.md b/content/cards/法语中不发音的字母.md
new file mode 100644
index 00000000..5a491680
--- /dev/null
+++ b/content/cards/法语中不发音的字母.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<!--more-->
+3. 单词末尾的 E
+ - 如:table、pomme、robe、**porte**、vie
+ - 值得注意的是,在末尾有 E 的情况下,在 E 之前的原本不发音的字母需要发音,例如 porte 中的 T 原本不发音,但因为 E 的存在,T 需要发音
+4. 复数形式动词末尾的 -ENT
+ - 如:parlent、mangent、choisissent
+
+[联诵](/cards/liaison/)(liaison)会激活原本不发音的辅音。
+
+<span style="font-size:80%">Source: [YouTube](https://www.youtube.com/watch?v=sSCEoAWw0q4)</span>
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。
+
+## 我常读的中文博客
+
+<div class="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" >}}
+</div>
+
+## 我常听的中文播客
+
+<div class="linkroll">
+{{< 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" >}}
+</div>
+
+---
+
+Check out some cool English sites [here](/en/blogroll).
diff --git a/content/posts/weekly/31.md b/content/posts/weekly/31.md
index 2b4954eb..66a6c8c8 100644
--- a/content/posts/weekly/31.md
+++ b/content/posts/weekly/31.md
@@ -29,9 +29,9 @@ 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" >}}
> I want you to help keep me from growing older.
->
+>
> Just let me snot on your shoulder,
->
+>
> when all that I'm thinking about is him.
<!--more-->
## 🙋 在做什么
@@ -98,10 +98,10 @@ aplayer: true
其中包含一些「当我们刚刚开始的时候,大家都笑话我们……」这样的陈词滥调,但有一条建议很值得思考:如果你有野心,但却没有什么实际的计划,不妨先找到与你志同道合的人。
> There’re a huge number of options, and you have to actively figure out which is the best for you. And the best way to do that is people. Find the interesting people.
->
+>
> 选择很多,你必须主动去搞明白哪一个最适合你,最好的方式就是通过人。找到那些有趣的人。
-[#群体](/tags/群体/) [#职业](/tags/职业/)
+[#群体](/tags/群体/) [#职业](/tags/职业/)
### 美国影视作品里的亚洲人
@@ -115,7 +115,7 @@ aplayer: true
此外,我不认为这篇文章的数据有多准确,因为他们只收集了「主要由亚洲演员参演」和「旨在描绘美裔亚洲人生活」的电影,这类电影本身就会更在意文化准确性,而在其他电影里作为配角登场的亚洲人是否被准确地呈现了,并没有纳入统计范围。这就是典型的路灯效应嘛。
-[#文化](/tags/文化/) [#种族](/tags/种族/)
+[#文化](/tags/文化/) [#种族](/tags/种族/)
## 💡 新知复盘
diff --git a/content/posts/weekly/32.md b/content/posts/weekly/32.md
new file mode 100644
index 00000000..875e86b9
--- /dev/null
+++ b/content/posts/weekly/32.md
@@ -0,0 +1,110 @@
+---
+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 "文章链接:[CAPTCHAs are over](https://behind.pretix.eu/2025/05/23/captchas-are-over/)" "📜" >}}
+
+在网络售票的应用中,人机验证已经不再有用了,根本无法防止黄牛用机器人抢票。
+
+作者指出,人机验证的基本逻辑是让用户解决「人类很容易解决,但计算机难以解决的问题」,但随着软件的发展,尤其是人工智能的兴起,这样的问题越来越少了。文字必须要复杂到人类也难以解决,才能防止 AI 识别,基于图像和音频的验证也是如此。
+
+另一种今年来流行的人机验证方式在一定程度上解决了这个问题,也就是基于机器学习的人机验证,通过分析用户的网络环境和鼠标运动轨迹等信号来判断用户是不是机器人。但作者指出,这种验证方式非常不利于个人隐私,而且新用户和使用辅助技术访问网站的用户很容易被错误地识别为机器人。对于残障人士来说,被人机验证挡在网站外是很难受的。作者认为,冒着把一群用户挡在外面的风险防止机器人,不仅缺乏专业素养,而且可能会面临法律责任。
+
+还有一种策略是让计算变得「昂贵」。通过在验证时让用户的计算机计算冗长的哈希函数,消耗算力资源,让大规模机器人访问变得昂贵。但作者认为这也是有问题的,因为黄牛每卖一张票能赚好几百,根本不在乎这点价格。这种策略用来对付 AI 爬虫或许有用,我想起之前 Hacker News 有人用压缩包炸弹(ZIP Bomb)[^1]防止恶意爬虫访问自己的网站。
+
+作者还指出,现在网上有付费服务,可以雇佣第三世界国家的廉价劳动力,让真人帮自己的机器人通过人机验证,而且速度还很快,价格也很低。只要黄牛有利可图,就不担心这点成本。
+
+就算用手机号、ID 之类的身份证明绑定门票,黄牛仍然可以通过售卖机器人抢票服务赚钱,而且这对普通用户来说不太友好。
+
+作者借鉴数据库系统的 CAP 理论,提出了 BAP 理论,即在 Bot-resistance(防机器人)、Accessibility(无障碍)和 Privacy-friendly(隐私友好)中只能三选二,不可能同时保证三者。
+
+![](https://image.guhub.cn/uPic/2025/06/image-20250606172957551.png)
+
+### 如何对抗失序?
+
+{{< 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" >}}
+
+## 🗣️ 碎碎念
+
+-
+
+[^1]: 一个体积很小但解压后能达到 PB 级别的压缩包 \ No newline at end of file
diff --git a/layouts/_default/featured.html b/layouts/_default/featured.html
index 5b921e05..86d5f53a 100644
--- a/layouts/_default/featured.html
+++ b/layouts/_default/featured.html
@@ -16,18 +16,14 @@
<header>
<div class="posts-item-meta">
<p>
- <time>
- {{ .Date.Format "Jan 2, 2006" }}
- </time>
+ <time>{{ .Date.Format "Jan 2, 2006" }}</time>
<span>·</span>
- {{ range .Params.tags }}
- <a class="post-tag" href="{{ site.LanguagePrefix }}/tags/{{ lower . | urlize }}/">#{{ . }}</a>
- {{ end }}
+ {{ partial "components/tags" . }}
</p>
<h2 class="posts-item-title">
<a
href="{{ .Permalink }}"
- data-umami-event="Click post link from featured"
+ data-umami-event="🪶 Click post link from featured"
>
{{ if eq .Section "library" }}
读《{{ .Title }}》
diff --git a/layouts/_default/section.html b/layouts/_default/section.html
index d1ad5401..c051990e 100644
--- a/layouts/_default/section.html
+++ b/layouts/_default/section.html
@@ -2,9 +2,8 @@
<article class="posts">
{{ partial "header.html" . }}
<div id="posts-archive" class="posts-list">
- {{ partial "components/wordCountChart.html" . }}
<!-- Post Archive List -->
- {{ $first := true }} <!-- 在循环外定义一次 $first 变量 -->
+ {{ $remainingMonthsToOpen := 3 }}
{{ range (where site.RegularPages "Type" "eq" "posts").GroupByDate "2006" -}}
<section class="posts-year-archive">
<h1 class="posts-year-title">
@@ -12,8 +11,8 @@
<small class="font-mono">{{ T "archivePage.postCountAnnual" (len .Pages) }}</small>
</h1>
- {{ range .Pages.GroupByDate "January" }} <!-- 这里每个月的循环 -->
- <details class="posts-month-archive"{{ if $first }} open{{ end }}>
+ {{ range .Pages.GroupByDate "January" }}
+ <details class="posts-month-archive"{{ if gt $remainingMonthsToOpen 0 }} open{{ end }}>
<summary>
<h2 class="posts-month-title">
{{ .Key }}
@@ -44,7 +43,7 @@
</ul>
</div>
</details>
- {{ $first = false }} <!-- 将 $first 设置为 false 只在第一个月份显示后 -->
+ {{ $remainingMonthsToOpen = sub $remainingMonthsToOpen 1 }}
{{ end }}
</section>
{{ end }}
diff --git a/layouts/_default/stats.html b/layouts/_default/stats.html
index 07f9845f..8ca0cf47 100644
--- a/layouts/_default/stats.html
+++ b/layouts/_default/stats.html
@@ -117,6 +117,9 @@
</table>
</section>
+ <h2>每月文章字数</h2>
+ {{ partial "components/word-count-chart" . }}
+
<hr>
<section>
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 @@
<ol class="term-list-posts">
{{ range $uncategorized }}
<li>
- <a href="{{ .RelPermalink }}" data-umami-event="Click Post Link from Uncategorized">
+ <a href="{{ .RelPermalink }}" data-umami-event="🈚️ Click Post Link from Uncategorized">
{{ .Title }}{{ with .Params.subtitle }}:<span class="posts-subtitle">{{. }}</span>
{{ end }}
</a>
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" }} <!-- 获取 "cards" 部分的内容 -->
{{- $paginator := .Paginate $cards.Pages 10 }} <!-- 对该部分内容进行分页 -->
{{- range $paginator.Pages }}
- <div class="card"
- style="view-transition-name: card-{{ .File.UniqueID }}">
- <div class="card-header">
- <h3 class="card-title">
- <a href="{{ .Permalink }}" class="card-title-link">{{ .Title }}</a>
- </h3>
- {{- if .Params.tags }}
- <p class="card-tags markdown-body">
- {{- range .Params.tags }}
- <a href="{{ "/tags/" | relURL }}{{ . | urlize }}" class="card-tag">#{{ . }}</a>
- {{- end }}
- </p>
- {{- end }}
- </div>
-
- <div class="card-content markdown-body">
- {{ .Summary }}
- </div>
- </div>
+ {{ partial "items/card" (dict "context" . "summary" true) }}
{{- end }}
</div>
diff --git a/layouts/cards/single.html b/layouts/cards/single.html
index d75d1ffa..0b269bca 100644
--- a/layouts/cards/single.html
+++ b/layouts/cards/single.html
@@ -1,34 +1,7 @@
{{ define "main" }}
<article class="card-page">
- <a href="{{ .Site.LanguagePrefix }}/cards"
- class="title-image-container">
- <img src="{{ .Site.Params.images.header }}" alt="Logo"
- class="invert-if-dark title-image"
- style="view-transition-name: title-image"
- />
- </a>
- <div class="card markdown-body post-content"
- style="view-transition-name: card-{{ .File.UniqueID }}">
- <div class="card-header">
- <h3 class="card-title"
- data-pagefind-meta="title"
- data-pagefind-sort="date[data-date], weight[data-weight]"
- data-date="{{ .Date.Format "2006-01-02" }}"
- data-weight="5">
- {{ .Title }}
- </h3>
- {{- if .Params.tags }}
- <p class="card-tags">
- {{- range .Params.tags }}
- <a href="{{ "/tags/" | relURL }}{{ . | urlize }}" class="card-tag">#{{ . }}</a>
- {{- end }}
- </p>
- {{- end }}
- </div>
- <div class="card-content">
- {{ .Content }}
- </div>
- </div>
+ {{ partial "components/logo" (dict "link" "cards") }}
+ {{ partial "items/card" (dict "context" .) }}
{{- /* 查询引用了这个卡片的文章 */ -}}
{{- $currentCard := .File.BaseFileName -}} <!-- 获取当前卡片的文件名 -->
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 @@
<a class="post-series-item"
href="{{ .link }}"
title="{{ .description }}"
- data-umami-event="Click series link from Banner"
+ data-umami-event="🚩 Click series link from Banner"
>
<div class="post-series-cover">
<img src="{{ .cover }}" />
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 @@
<ul class="term-list-posts">
{{ range where .Pages "Section" "ne" "cards" }}
<li>
- <a href="{{ .RelPermalink }}" data-umami-event="Click Post Link from Category Page">
+ <a href="{{ .RelPermalink }}" data-umami-event="🗃️ Click Post Link from Category Page">
{{ .Title }}{{ with .Params.subtitle }}:<span class="posts-subtitle">{{. }}</span>
{{ end }}
</a>
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" . }}
<h1 class="post-title" data-pagefind-meta="title">{{ .Title }}</h1>
- <div class="post-meta">
- {{ if .Date }}
- <time class="post-date"
- datetime="{{ .Date.Format "2006-01-02 15:04:05 MST" }}"
- data-pagefind-sort="date[datetime], weight[data-weight]"
- data-weight="15">
- {{ .Date.Format "2006年1月2日" }}
- </time>
- {{ end }}
- </div>
+ <div class="post-meta">{{ partial "components/date" . }}</div>
</header>
<!-- Post Content -->
diff --git a/layouts/index.html b/layouts/index.html
index abd5a9f7..cc1042fd 100644
--- a/layouts/index.html
+++ b/layouts/index.html
@@ -13,16 +13,14 @@
<header>
<div class="posts-item-meta">
<p class="font-mono">
- <time>
- {{ .Date.Format "Jan 2" }},
- </time>
+ <time>{{ .Date.Format "January 2" }},</time>
<span>in <a href="/{{ .Section }}/">{{ .Section }}</a></span>
</p>
<h2 class="posts-item-title"
{{ if $firstPost }} style="margin-bottom: 0"{{ end }}>
<a
href="{{ .Permalink }}"
- data-umami-event="Click post link from index"
+ data-umami-event="🏠 Click post link from index"
>
{{ if eq .Section "library" }}
读《{{ .Title }}》
@@ -55,7 +53,7 @@
{{ end }}
</div>
<a href="/posts" class="index-section-morelink"
- data-umami-event="Click more posts link">
+ data-umami-event="➕ Click more posts link">
{{ T "moreLinks.posts" }}
</a>
</section>
@@ -67,33 +65,12 @@
{{- $cards := .Site.GetPage "section" "cards" }} <!-- 获取 "cards" 部分的内容 -->
{{- $paginator := .Paginate $cards.Pages 4 }} <!-- 对该部分内容进行分页 -->
{{- range $paginator.Pages }}
- <div class="card"
- style="view-transition-name: card-{{ .File.UniqueID }}">
- <div class="card-header">
- <h3 class="card-title">
- <a
- href="{{ .Permalink }}"
- data-umami-event="Click card link from index"
- class="card-title-link">{{ .Title }}</a>
- </h3>
- {{- if .Params.tags }}
- <p class="card-tags markdown-body">
- {{- range .Params.tags }}
- <a href="{{ "/tags/" | relURL }}{{ . | urlize }}" class="card-tag">#{{ . }}</a>
- {{- end }}
- </p>
- {{- end }}
- </div>
-
- <div class="card-content markdown-body">
- {{ .Summary }}
- </div>
- </div>
+ {{ partial "items/card" (dict "context" . "summary" true) }}
{{- end }}
</div>
<div style="margin: 1rem 0">
<a href="/cards" class="index-section-morelink"
- data-umami-event="Click more cards link">
+ data-umami-event="➕ Click more cards link">
{{ T "moreLinks.cards" }}
</a>
</div>
diff --git a/layouts/library/single.html b/layouts/library/single.html
index fa53149b..1f051da7 100644
--- a/layouts/library/single.html
+++ b/layouts/library/single.html
@@ -5,6 +5,7 @@
style="view-transition-name: book-{{ .File.UniqueID }}">
<img
class="lazy" loading="lazy"
+ data-pagefind-meta="image[src]"
src="{{ .Params.cover }}"
/>
</div>
@@ -21,24 +22,17 @@
</p>
<!-- 导航作用的骷髅头图标 -->
<div>
- <a href="{{ .Site.LanguagePrefix }}/library"
- class="title-image-container">
- <img src="{{ .Site.Params.images.header }}" alt="Logo"
- class="invert-if-dark title-image"
- style="view-transition-name: title-image"
- />
- </a>
+ {{ partial "components/logo" (dict "link" "library") }}
</div>
</div>
<div class="markdown-body book-body">
<div class="book-content">
{{ .Content }}
</div>
+ <!-- Endnotes -->
+ {{ partial "components/endnotes" . }}
<div class="book-footer">
- <p>于 <time
- data-pagefind-sort="date[data-date], weight[data-weight]"
- data-date="{{ .Date.Format "2006-01-02" }}"
- data-weight="10">{{ .Date.Format "2006-01-02" }}</time> 读完</p>
+ <p>于 {{ partial "components/date" . }} 读完</p>
</div>
</div>
{{ partial "components/comment.html" . }}
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 @@
<div class="post-banner">
<img
class="lazy" loading="lazy"
+ data-pagefind-meta="image[src]"
src="{{ . }}"
>
</div>
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 }}
+ <a class="post-category" href="{{ .RelPermalink }}">
+ {{ .Params.icon }}
+ <span>{{ .LinkTitle }}</span>
+ </a>
+ {{ end }}
+{{ end }}
diff --git a/layouts/partials/components/comment.html b/layouts/partials/components/comment.html
index 2bdab023..13fff97e 100644
--- a/layouts/partials/components/comment.html
+++ b/layouts/partials/components/comment.html
@@ -27,11 +27,12 @@
</div>
{{ if eq .Site.Language.Lang "zh" }}
<p class="links-container">
- <a href="https://t.me/teaparty418" target="_blank">
+ <a href="https://t.me/teaparty418" target="_blank"
+ data-umami-event="✈️ Click Telegram link from comment footer">
<img src="/img/telegram.svg" alt="Telegram Logo" />
加入 Telegram 群组参与讨论
</a>
- <a href="/sponsor"><span>💗</span>赞助作者</a>
+ <a href="/sponsor" data-umami-event="💗 Click sponsor button from comment footer"><span>💗</span>赞助作者</a>
</p>
{{ end }}
<!-- giscus script -->
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 }}
+
+ <time class="post-date"
+ datetime="{{ .Date.Format "2006-01-02 15:04:05 MST" }}"
+ data-pagefind-sort="date[datetime], weight[data-weight]"
+ data-weight="{{ if .Params.featured }}30{{ else }}20{{ end }}">
+ {{ .Date.Format "2006年1月2日" }} {{ $fuzzyTime }}
+ </time>
+{{ 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 }}
+<hr>
+<div id="post-endnotes">
+ <ul>
+ {{ range .Params.endnotes }}
+ <li>{{ . | markdownify }}</li>
+ {{ end }}
+ </ul>
+</div>
+{{ 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/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 }}
+
+<a href="{{ .Site.LanguagePrefix }}/{{ $link }}"
+ class="title-image-container">
+ <img src="{{ $src }}" alt="Logo"
+ class="invert-if-dark title-image"
+ style="view-transition-name: title-image" />
+</a>
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 }}
+<div class="nrt post-content">
+ <h4 class="nrt-title">{{ T "nowReadThis" }}</h4>
+ {{ range . }}
+ <div class="nrt-header">
+ <a class="nrt-link" href="{{ .RelPermalink }}" data-umami-event="🤔 Click Related Post">
+ {{ .LinkTitle }}
+ {{ with .Params.subtitle }}
+ <span class="nrt-subtitle">:{{ . }}</span>
+ {{ end }}
+ </a>
+ <span class="nrt-reading-time">⏱️ {{ .ReadingTime }}min </span>
+ </div>
+ <div class="nrt-summary">
+ <p>{{ .Summary | plainify }}</p>
+ </div>
+ {{ end }}
+</div>
+{{ end }}
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 @@
<header id="post-page-header"
class="{{ with .Params.banner }}with-banner{{ end }} {{ if eq .Section "fictions" }}fiction-page-header{{ end }}">
- <a href="{{ .Site.LanguagePrefix }}/{{ if eq .Section "fictions" }}fictions{{ end }}"
- class="title-image-container">
- <img src="{{ if eq .Section "fictions" }}/img/potted-skeleton.svg{{ else }}{{ .Site.Params.images.header }}{{ end }}" alt="Logo"
- class="invert-if-dark title-image"
- style="view-transition-name: title-image"
- />
- </a>
+ {{ if eq .Section "fictions" }}
+ {{ partial "components/logo" (dict "src" "/img/potted-skeleton.svg" "link" "fictions") }}
+ {{ else }}
+ {{ partial "components/logo" }}
+ {{ end }}
</header>
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 @@
<div id="posts-list-navigation">
<ul>
<li class="{{ if eq "/" $.Page.RelPermalink }}active{{ end }}">
- <a href="{{ .Site.LanguagePrefix }}/">{{ T "postNav.latest" }}</a>
+ <a data-umami-event="🧭 Click postnav link" href="{{ .Site.LanguagePrefix }}/">{{ T "postNav.latest" }}</a>
</li>
{{ if eq .Site.Language.Lang "zh" }}
<li class="{{ if eq "/featured/" $.Page.RelPermalink }}active{{ end }}">
- <a href="{{ .Site.LanguagePrefix }}/featured">{{ T "postNav.featured" }}</a>
+ <a data-umami-event="🧭 Click postnav link" href="{{ .Site.LanguagePrefix }}/featured">{{ T "postNav.featured" }}</a>
</li>
<li class="{{ if eq "/categories/" $.Page.RelPermalink }}active{{ end }}">
- <a href="{{ .Site.LanguagePrefix }}/categories">{{ T "postNav.categories" }}</a>
+ <a data-umami-event="🧭 Click postnav link" href="{{ .Site.LanguagePrefix }}/categories">{{ T "postNav.categories" }}</a>
</li>
<li class="{{ if eq "/tags/" $.Page.RelPermalink }}active{{ end }}">
- <a href="{{ .Site.LanguagePrefix }}/tags">{{ T "postNav.tags" }}</a>
+ <a data-umami-event="🧭 Click postnav link" href="{{ .Site.LanguagePrefix }}/tags">{{ T "postNav.tags" }}</a>
</li>
{{ end }}
<li id="search-instruction">
<span>{{ T "searchInstruction" }}</span>
</li>
<li class="list-decoration invert-if-dark{{ if eq "/stats/" $.Page.RelPermalink }} active{{ end }}">
- <a href="{{ .Site.LanguagePrefix }}/stats" class="icon-link"><img src="/img/graph.svg" /></a>
+ <a href="{{ .Site.LanguagePrefix }}/stats" class="icon-link"
+ data-umami-event="📈 Click stats page link"><img src="/img/graph.svg" /></a>
<li>
</ul>
</div>
diff --git a/layouts/partials/components/tags.html b/layouts/partials/components/tags.html
new file mode 100644
index 00000000..6ff7f594
--- /dev/null
+++ b/layouts/partials/components/tags.html
@@ -0,0 +1,3 @@
+{{ range .Params.tags }}
+<a class="tag" href="{{ site.LanguagePrefix }}/tags/{{ lower . | urlize }}/">#{{ . }}</a>
+{{ 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 }}
<div id="toc-container"><div id="toc">{{ .TableOfContents }}</div></div>
<style>
/* toc */
@@ -113,3 +114,4 @@ document.addEventListener('DOMContentLoaded', () => {
headings.forEach(heading => observer.observe(heading));
});
</script>
+{{ end }}
diff --git a/layouts/partials/components/wordCountChart.html b/layouts/partials/components/word-count-chart.html
index 65d0e986..65d0e986 100644
--- a/layouts/partials/components/wordCountChart.html
+++ b/layouts/partials/components/word-count-chart.html
diff --git a/layouts/partials/header.html b/layouts/partials/header.html
index 92e81353..214552d6 100644
--- a/layouts/partials/header.html
+++ b/layouts/partials/header.html
@@ -1,12 +1,7 @@
<header id="site-header">
<!-- Header Title -->
<div class="header-title">
- <a href="{{ .Site.LanguagePrefix }}/">
- <img src="{{ .Site.Params.images.header }}" alt="Logo"
- class="invert-if-dark title-image"
- style="view-transition-name: title-image"
- />
- </a>
+ {{ partial "components/logo" }}
<a class="title-link" href="{{ .Site.LanguagePrefix }}/"
>{{ .Site.Params.headTitle }}</a
>
@@ -16,7 +11,7 @@
<nav class="navigation">
{{ range .Site.Params.nav }}
<div class="navigation-item {{ if strings.Contains $.Page.RelPermalink .link }}active{{ end }}">
- <a href="{{ .link }}" target="{{ .target }}">{{ .name }}</a>
+ <a href="{{ .link }}" target="{{ .target }}" data-umami-event="💊 Click header navigation">{{ .name }}</a>
</div>
{{ end }}
</nav>
@@ -24,7 +19,7 @@
{{- $lang := .Site.Language.Lang -}}
{{- $switch := dict "en" (dict "url" "/zh/" "label" "切换至中文") "zh" (dict "url" "/en/" "label" "Switch to English") -}}
{{- $entry := index $switch $lang -}}
- <a href="{{ $entry.url }}" data-umami-event="Switch Language"
+ <a href="{{ $entry.url }}" data-umami-event="🌍 Switch Language"
class="no-swup" title="{{ $entry.label }}">
{{ partial "snippets/globe-icon" . }}
</a>
diff --git a/layouts/partials/items/card.html b/layouts/partials/items/card.html
new file mode 100644
index 00000000..b8a3c7c1
--- /dev/null
+++ b/layouts/partials/items/card.html
@@ -0,0 +1,18 @@
+{{ $ctx := .context }}
+{{ $showSummary := .summary }}
+<div class="card markdown-body post-content"
+ style="view-transition-name: card-{{ $ctx.File.UniqueID }}">
+ <div class="card-header">
+ <h3 class="card-title"
+ data-pagefind-meta="title"
+ data-pagefind-sort="date[data-date], weight[data-weight]"
+ data-date="{{ .Date.Format "2006-01-02" }}"
+ data-weight="5">
+ <a href="{{ $ctx.RelPermalink }}">{{ $ctx.Title }}</a>
+ </h3>
+ <div class="card-tags">{{ partial "components/tags" $ctx }}</div>
+ </div>
+ <div class="card-content">
+ {{ if $showSummary }}{{ $ctx.Summary }}{{ else }}{{ $ctx.Content }}{{ end }}
+ </div>
+</div>
diff --git a/layouts/posts/single.html b/layouts/posts/single.html
index d31c9f30..7a7051f0 100644
--- a/layouts/posts/single.html
+++ b/layouts/posts/single.html
@@ -16,43 +16,10 @@
</h1>
<!-- Post Meta -->
<div class="post-meta">
- {{ if .Date }}
- {{ $hour := .Date.Hour }}
- {{ $fuzzyTime := "" }}
- {{ if lt $hour 5 }}
- {{ $fuzzyTime = "凌晨" }}
- {{ else if lt $hour 7 }}
- {{ $fuzzyTime = "清晨" }}
- {{ else if lt $hour 11 }}
- {{ $fuzzyTime = "早上" }}
- {{ else if lt $hour 13 }}
- {{ $fuzzyTime = "中午" }}
- {{ else if lt $hour 17 }}
- {{ $fuzzyTime = "下午" }}
- {{ else if lt $hour 19 }}
- {{ $fuzzyTime = "傍晚" }}
- {{ else if lt $hour 23 }}
- {{ $fuzzyTime = "晚上" }}
- {{ else }}
- {{ $fuzzyTime = "深夜" }}
- {{ end }}
-
- <time class="post-date"
- datetime="{{ .Date.Format "2006-01-02 15:04:05 MST" }}"
- data-pagefind-sort="date[datetime], weight[data-weight]"
- data-weight="{{ if .Params.featured }}30{{ else }}20{{ end }}">
- {{ .Date.Format "2006年1月2日" }} {{ $fuzzyTime }}
- </time>
- {{ end }}
- {{ if or .Params.categories .Params.tags }}
- <span>·</span>
- {{ end }}
- {{ if .Params.categories }}
- <a class="post-category" href="/categories/{{ .Params.categories | urlize }}">{{ .Params.categories }}</a>
- {{ end }}
- {{ range .Params.tags }}
- <a class="post-tag" href="{{ site.LanguagePrefix }}/tags/{{ lower . | urlize }}/">#{{ . }}</a>
- {{ end }}
+ {{ partial "components/date" . }}
+ {{ if or .Params.categories .Params.tags }}<span>·</span>{{ end }}
+ {{ partial "components/category-pill" . }}
+ {{ partial "components/tags" . }}
</div>
</header>
@@ -60,46 +27,18 @@
<div class="post-content markdown-body"
style="view-transition-name: post-content-{{ .File.UniqueID }}">
<!-- TOC -->
- {{ if .Params.toc }}
{{ partial "components/toc" . }}
- {{ end }}
<!-- Content -->
- <div id="post-content">{{ .Content }}</div>
- <!-- Endnotes -->
- {{ if .Params.endnotes }}
- <hr>
- <div id="post-endnotes">
- <ul>
- {{ range .Params.endnotes }}
- <li>{{ . | markdownify }}</li>
- {{ end }}
- </ul>
+ <div id="post-content">
+ {{ .Content }}
</div>
- {{ end }}
+ <!-- Endnotes -->
+ {{ partial "components/endnotes" . }}
</div>
<!-- Comment -->
{{ partial "components/comment.html" . }}
-
<!-- Now Read This -->
- {{ with site.RegularPages.Related . | first 1 }}
- <div class="nrt post-content">
- <h4 class="nrt-title">{{ T "nowReadThis" }}</h4>
- {{ range . }}
- <div class="nrt-header">
- <a class="nrt-link" href="{{ .RelPermalink }}" data-umami-event="Click Related Post">
- {{ .LinkTitle }}
- {{ with .Params.subtitle }}
- <span class="nrt-subtitle">:{{ . }}</span>
- {{ end }}
- </a>
- <span class="nrt-reading-time">⏱️ {{ .ReadingTime }}min </span>
- </div>
- <div class="nrt-summary">
- <p>{{ .Summary | plainify }}</p>
- </div>
- {{ end }}
- </div>
- {{ end }}
+ {{ partial "components/now-read-this.html" . }}
</article>
{{ end }}
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 @@
+<a href="{{.Get "link" }}" target="_blank"
+ class="{{ if (.Get "type") }}{{ .Get "type" }}-link{{ else }}blog-link{{ end }}">
+ {{ if and (isset .Params "image") .Params.image }}
+ <div class="link-image">
+ <img src="{{ .Params.image }}" class="no-fancybox" alt="{{ .Params.title }}" />
+ </div>
+ {{ end }}
+ {{ if ne (.Get "type") "podcast" }}
+ <div class="link-content">
+ <h4>{{.Get "title" }}</h4>
+ <p>{{.Get "description" }}</p>
+ </div>
+ {{ end }}
+</a>
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 @@
<ul class="term-list-posts">
{{ range where .Pages "Section" "not in" (slice "cards" "library") }}
<li>
- <a href="{{ .RelPermalink }}" data-umami-event="Click Post Link from Category Page">
+ <a href="{{ .RelPermalink }}" data-umami-event="🗃️ Click Post Link from Category Page">
{{ .Title }}{{ with .Params.subtitle }}:<span class="posts-subtitle">{{. }}</span>
{{ end }}
</a>
@@ -28,7 +28,7 @@
{{ range $cards }}
<div class="card">
<h3>
- <a href="{{ .RelPermalink }}" data-umami-event="Click Card Link from Category Page">
+ <a href="{{ .RelPermalink }}" data-umami-event="🗃️ Click Card Link from Category Page">
{{ .Title }}
</a>
</h3>