From 0cf51c3148e35fb0942edaa06b5f6d6e3ad97fdc Mon Sep 17 00:00:00 2001 From: Ryan Wang Date: Mon, 26 Aug 2024 14:49:13 +0800 Subject: [PATCH] feat: add support for hiding upvote and share buttons on posts (#165) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 支持隐藏文章的点赞和分享按钮。 /kind feature Fixes https://github.com/halo-dev/theme-earth/issues/158 ```release-note 支持隐藏文章的点赞和分享按钮。 ``` --- settings.yaml | 12 ++++++++++++ templates/post.html | 7 ++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/settings.yaml b/settings.yaml index 187e825..d579d2f 100644 --- a/settings.yaml +++ b/settings.yaml @@ -110,8 +110,20 @@ spec: value: github - label: Tailwind CSS Typography value: tailwind + - $formkit: checkbox + name: show_upvote_button + label: 显示点赞按钮 + value: true + - $formkit: checkbox + name: show_share_button + id: show_share_button + label: 显示分享按钮 + value: true - $formkit: repeater + if: $get(show_share_button).value name: share_items + key: share_items + id: share_items label: 分享按钮 value: - id: wechat diff --git a/templates/post.html b/templates/post.html index e5c10f6..5971b90 100644 --- a/templates/post.html +++ b/templates/post.html @@ -59,7 +59,11 @@

-
+
@@ -94,6 +98,7 @@