From 385e36dbef14d6a3d24685dc032a70c3d0d16b8b Mon Sep 17 00:00:00 2001 From: BigCoke233 Date: Tue, 6 Jan 2026 00:29:30 +0800 Subject: feat: new webmention section with better support for replies, likes and mentions --- i18n/en.yml | 2 + i18n/zh.yml | 4 +- layouts/_partials/components/toggle-button.html | 22 ++---- .../posts/action-menu/webmention-button.html | 17 ++--- .../posts/action-menu/webmention-section.html | 86 ++++++++++++++++++---- uno.config.js | 2 +- 6 files changed, 89 insertions(+), 44 deletions(-) diff --git a/i18n/en.yml b/i18n/en.yml index 48de8a6d..766c00fc 100644 --- a/i18n/en.yml +++ b/i18n/en.yml @@ -63,3 +63,5 @@ webmention: formDesc: You can write an article to respond to this post, or post something on social media, then submit the link of the related page here to send me Webmention. formPlaceholder: URL of your post submit: Ping me! + likedBy: %d people liked this page + mentionsHeading: Mentions diff --git a/i18n/zh.yml b/i18n/zh.yml index ee980cc7..0befc7b6 100644 --- a/i18n/zh.yml +++ b/i18n/zh.yml @@ -59,6 +59,8 @@ actionMenu: rss_comment_link: "读完啦?来坐坐吧" webmention: fetching: 正在获取 Webmention... - formDesc: 你可以撰写一篇文章回应此文,或者在社交媒体上发帖,然后在这里提交相关页面的链接,即可向我发送 Webmention。 + formDesc: 你可以撰写一篇文章回应此文,然后在这里提交相关页面的链接,只要提交的页面中包含这个页面的链接,即可向我发送 Webmention。 formPlaceholder: 你的文章的 URL submit: 提交 + likedBy: %d 人喜欢了这篇文章 + mentionsHeading: 提及这篇文章的 diff --git a/layouts/_partials/components/toggle-button.html b/layouts/_partials/components/toggle-button.html index 2b1de2f9..29e3440e 100644 --- a/layouts/_partials/components/toggle-button.html +++ b/layouts/_partials/components/toggle-button.html @@ -1,20 +1,8 @@ -{{/* - Reusable Toggle Button Component - - Parameters: - - id: (string) Unique identifier for the button group (e.g. "comments"). - Used to generate IDs: {id}-toggle, {id}-section, {id}-count. - - title: (string) Tooltip title. - - icon: (string) Path to the icon image. - - countId: (string, optional) Override for count element ID. Defaults to "{id}-count". - - sectionId: (string, optional) Override for section element ID. Defaults to "{id}-section". - - buttonId: (string, optional) Override for button element ID. Defaults to "{id}-toggle". - - group: (string, optional) Mutual exclusion group name. If provided, opening this toggle will close others in the same group. -*/}} {{ $id := .id }} {{ $buttonId := default (printf "%s-toggle" $id) .buttonId }} {{ $sectionId := default (printf "%s-section" $id) .sectionId }} {{ $countId := default (printf "%s-count" $id) .countId }} +{{ $count := default "..." .count }} {{ $group := .group }} diff --git a/layouts/_partials/posts/action-menu/webmention-section.html b/layouts/_partials/posts/action-menu/webmention-section.html index 55588444..441e2491 100644 --- a/layouts/_partials/posts/action-menu/webmention-section.html +++ b/layouts/_partials/posts/action-menu/webmention-section.html @@ -1,27 +1,85 @@