summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEltrac <hi@guhub.cn>2025-09-19 21:54:39 +0800
committerEltrac <hi@guhub.cn>2025-09-19 21:54:39 +0800
commitc48736351d78649a86ebde4365d463f49b746dec (patch)
tree475bea880c118921de7e18163220f242378be16e
parent9fe05ed14167e243e516dfeb4b7fef5484cea6a4 (diff)
parenteee9b7c4ded1cb9e5ce18e07f6311b7846b61e6a (diff)
Merge branch 'master' of https://github.com/BigCoke233/geek-death-project
Former-commit-id: bf470534edec07ec7ae6c6afc32a3ed2e81051eb
-rw-r--r--i18n/en.yml15
-rw-r--r--i18n/zh.yml15
-rw-r--r--layouts/_partials/components/date.html23
-rw-r--r--layouts/_partials/posts/action-menu.html30
4 files changed, 65 insertions, 18 deletions
diff --git a/i18n/en.yml b/i18n/en.yml
index 0a96d993..a303a633 100644
--- a/i18n/en.yml
+++ b/i18n/en.yml
@@ -41,3 +41,18 @@ settings:
loremIpsum: Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
sampleText: Aa
otherOptions: Other Options
+fuzzyTimes:
+ afterMidnight: After Midnight
+ earlyMorning: Early Morning
+ morning: Morning
+ noon: Noon
+ afternoon: Afternoon
+ evening: Evening
+ night: Night
+ midnight: Midnight
+actionMenu:
+ telegramChannel: Telegram Channel
+ sponsor: Buy me a coffee
+ comment: Comment
+ like: Sacrifice your heart
+ liked: You've already made your sacrifice
diff --git a/i18n/zh.yml b/i18n/zh.yml
index 4120717e..37b2511d 100644
--- a/i18n/zh.yml
+++ b/i18n/zh.yml
@@ -41,3 +41,18 @@ settings:
loremIpsum: 对我个人而言,科学和人文谁更有意义不仅仅是一个重大的事件,还可能会改变我的人生。 我们都知道,只要有意义,那么就必须慎重考虑。问题的关键究竟为何? 在这种不可避免的冲突下,我们必须解决这个问题。 这样看来,我们一般认为,抓住了问题的关键,其他一切则会迎刃而解。从这个角度来看,生活中,若科学和人文谁更有意义出现了,我们就不得不考虑它出现了的事实。 塞内加曾经提到过,勇气通往天堂,怯懦通往地狱。这句话看似简单,但其中的阴郁不禁让人深思。所谓科学和人文谁更有意义,关键是科学和人文谁更有意义需要如何写。 那么,我们一般认为,抓住了问题的关键,其他一切则会迎刃而解。
sampleText: "字。"
otherOptions: 其他选项
+fuzzyTimes:
+ afterMidnight: '凌晨'
+ earlyMorning: '清晨'
+ morning: '早上'
+ noon: '中午'
+ afternoon: '下午'
+ evening: '傍晚'
+ night: '晚上'
+ midnight: '深夜'
+actionMenu:
+ telegramChannel: 'Telegram 频道'
+ sponsor: 赞助作者
+ comment: 评论
+ like: 为这篇文章献上心脏
+ liked: 你已经献上心脏了
diff --git a/layouts/_partials/components/date.html b/layouts/_partials/components/date.html
index 1998202f..5b8b8278 100644
--- a/layouts/_partials/components/date.html
+++ b/layouts/_partials/components/date.html
@@ -1,15 +1,15 @@
{{ 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" "晚上")
+ (dict "limit" 5 "label" (T "fuzzyTimes.afterMidnight"))
+ (dict "limit" 7 "label" (T "fuzzyTimes.earlyMorning"))
+ (dict "limit" 11 "label" (T "fuzzyTimes.morning"))
+ (dict "limit" 13 "label" (T "fuzzyTimes.noon"))
+ (dict "limit" 17 "label" (T "fuzzyTimes.afternoon"))
+ (dict "limit" 19 "label" (T "fuzzyTimes.evening"))
+ (dict "limit" 22 "label" (T "fuzzyTimes.night"))
}}
- {{ $fuzzyTime := "深夜" }} {{/* default */}}
+ {{ $fuzzyTime := (T "fuzzyTimes.midnight") }} {{/* default */}}
{{ range $fuzzyTimes }}
{{ if lt $hour .limit }}
{{ $fuzzyTime = .label }}
@@ -21,6 +21,11 @@
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 }}
+ {{ if eq .Site.Language.Lang "zh" }}
+ {{ .Date.Format "2006年1月2日" }}
+ {{ else }}
+ {{ .Date.Format "January 2, 2006" }},
+ {{ end }}
+ {{ $fuzzyTime }}
</time>
{{ end }}
diff --git a/layouts/_partials/posts/action-menu.html b/layouts/_partials/posts/action-menu.html
index 63c7ba5c..d05a61d1 100644
--- a/layouts/_partials/posts/action-menu.html
+++ b/layouts/_partials/posts/action-menu.html
@@ -3,8 +3,10 @@
<div class="flex justify-between items-center mb-6">
<div class="flex gap-2">
<button class="dark:invert flex items-center justify-center gap-1.5 min-w-12 h-12 px-2 border-none bg-transparent text-gray-600 cursor-pointer relative transition-all duration-200 hover:bg-black/5 hover:rounded-lg group"
- id="comments-toggle" title="评论" data-tooltip>
- <img src="/img/comments.svg" width="20" height="20" alt="评论" class="brightness-40 flex-shrink-0 dark:brightness-70 dark:contrast-120" />
+ id="comments-toggle" title="{{ T "actionMenu.comment" }}" data-tooltip>
+ <img src="/img/comments.svg" width="20" height="20"
+ alt="{{ T "actionMenu.comment" }}"
+ class="brightness-40 flex-shrink-0 dark:brightness-70 dark:contrast-120" />
<span class="text-xs font-bold text-gray-600 min-w-4 text-center bg-white/90 rounded-xl px-1.5 py-0.5 shadow-sm dark:text-gray-400 dark:bg-black/70" id="comment-count">...</span>
</button>
@@ -15,25 +17,35 @@
hover:bg-black/5 hover:rounded-lg group animate-count-infinite"
onclick="sendLike('{{ .File.UniqueID | urlize }}')"
id="like-btn-{{ .File.UniqueID | urlize }}"
- title="为这篇文章献上心脏"
- data-liked-title="你已经献上心脏了"
+ title="{{ T "actionMenu.like" }}"
+ data-liked-title="{{ T "actionMenu.liked" }}"
data-tooltip>
- <img src="/img/heart-organ.svg" width="20" height="20" alt="点赞" class="brightness-40 flex-shrink-0 transition-all duration-300 dark:brightness-70 dark:contrast-120" id="like-icon-{{ .File.UniqueID | urlize }}" />
+ <img src="/img/heart-organ.svg" width="20" height="20"
+ alt="{{ T "actionMenu.like" }}"
+ class="brightness-40 flex-shrink-0 transition-all duration-300 dark:brightness-70 dark:contrast-120" id="like-icon-{{ .File.UniqueID | urlize }}" />
<span class="text-xs font-bold text-gray-600 min-w-4 text-center bg-white/90 rounded-xl px-1.5 py-0.5 shadow-sm dark:text-gray-400 dark:bg-black/70" id="like-count-{{ .File.UniqueID | urlize }}">...</span>
</button>
</div>
</div>
+ {{ if eq .Site.Language.Lang "zh" }}
<div class="flex gap-1">
<a href="https://t.me/geedeapro" target="_blank" data-tooltip
- class="dark:invert flex items-center justify-center gap-1.5 min-w-8 h-8 px-1 border-none bg-transparent text-gray-600 cursor-pointer relative transition-all duration-200 hover:opacity-70 group" title="Telegram 频道:大脑充血" data-umami-event="✈️ Click Telegram link from post tabs">
- <img src="/img/radio.svg" width="16" height="16" alt="Telegram" class="brightness-40 flex-shrink-0 dark:brightness-70 dark:contrast-120" />
+ class="dark:invert flex items-center justify-center gap-1.5 min-w-8 h-8 px-1 border-none bg-transparent text-gray-600 cursor-pointer relative transition-all duration-200 hover:opacity-70 group"
+ title="{{ T "actionMenu.telegramChannel" }}" data-umami-event="✈️ Click Telegram link from post tabs">
+ <img src="/img/radio.svg" width="16" height="16"
+ alt="{{ T "actionMenu.telegramChannel" }}"
+ class="brightness-40 flex-shrink-0 dark:brightness-70 dark:contrast-120" />
</a>
<a href="/sponsor" data-tooltip
- class="dark:invert flex items-center justify-center gap-1.5 min-w-8 h-8 px-1 border-none bg-transparent text-gray-600 cursor-pointer relative transition-all duration-200 hover:opacity-70 group" title="赞助作者" data-umami-event="💗 Click sponsor button from post tabs">
- <img src="/img/coffee.svg" width="16" height="16" alt="赞助" class="brightness-40 flex-shrink-0 dark:brightness-70 dark:contrast-120" />
+ class="dark:invert flex items-center justify-center gap-1.5 min-w-8 h-8 px-1 border-none bg-transparent text-gray-600 cursor-pointer relative transition-all duration-200 hover:opacity-70 group"
+ title="{{ T "actionMenu.sponsor" }}" data-umami-event="💗 Click sponsor button from post tabs">
+ <img src="/img/coffee.svg" width="16" height="16"
+ alt="{{ T "actionMenu.sponsor" }}"
+ class="brightness-40 flex-shrink-0 dark:brightness-70 dark:contrast-120" />
</a>
</div>
+ {{ end }}
</div>
<!-- 评论区域 -->