From 27e0a53f7284a007893dab3ff3b2e32f0e81ac4c Mon Sep 17 00:00:00 2001 From: Erzbir Date: Sun, 16 Nov 2025 17:19:09 +0800 Subject: [PATCH] feat: add social profiles support --- settings.yaml | 48 +++++++++ src/styles/icons.scss | 3 + src/styles/sns.scss | 29 +++++ src/styles/style.scss | 1 + templates/index.html | 3 + templates/modules/header.html | 12 +-- templates/modules/sns.html | 194 ++++++++++++++++++++++++++++++++++ 7 files changed, 284 insertions(+), 6 deletions(-) create mode 100644 src/styles/sns.scss create mode 100644 templates/modules/sns.html diff --git a/settings.yaml b/settings.yaml index f235a54..bef4d1f 100644 --- a/settings.yaml +++ b/settings.yaml @@ -159,6 +159,54 @@ spec: value: "" help: 可填写自定义的 CSS, 会覆盖主题的样式 + - group: sns + label: 社交资料 + formSchema: + - $formkit: checkbox + name: switch + label: 全局开关 + value: true + help: 关闭之后不会显示社交资料 + - $formkit: checkbox + name: rss + label: RSS + value: false + - $formkit: text + name: github + label: GitHub + placeholder: "用户名" + value: + - $formkit: text + name: email + label: Email + placeholder: "邮箱地址" + value: + - $formkit: text + name: discord + label: Discord + placeholder: "分享链接" + value: + - $formkit: text + name: telegram + label: Telegram + placeholder: "用户名" + value: + - $formkit: text + name: facebook + label: Facebook + placeholder: "用户名" + value: + - $formkit: text + name: instagram + label: Instagram + placeholder: "用户名" + value: + - $formkit: text + name: x + label: X + placeholder: "用户名" + value: + - group: icp label: 备案设置 formSchema: diff --git a/src/styles/icons.scss b/src/styles/icons.scss index cfb5231..008b779 100644 --- a/src/styles/icons.scss +++ b/src/styles/icons.scss @@ -1,6 +1,9 @@ .icon-pixel, .icon-regular { display: none; +} + +.button-icon { width: calc(var(--font-theme-size) * 1.5); height: calc(var(--font-theme-size) * 1.5); } diff --git a/src/styles/sns.scss b/src/styles/sns.scss new file mode 100644 index 0000000..9e0f3ab --- /dev/null +++ b/src/styles/sns.scss @@ -0,0 +1,29 @@ +.sns-container { + display: flex; + align-items: center; + justify-content: flex-start; + gap: var(--font-theme-size); + flex-wrap: wrap; + padding: calc(var(--font-theme-size) * 0.75) 0; + font-size: inherit; +} + +.sns-container .sns-icon { + display: inline-flex; + align-items: center; + justify-content: center; + color: var(--color-theme-foreground); + text-decoration: none; +} + + +.sns-container .sns-icon svg { + width: calc(var(--font-theme-size) * 1.5); + height: calc(var(--font-theme-size) * 1.5); +} + +.sns-container .divider { + color: var(--color-theme-foreground); + font-weight: 300; + user-select: none; +} \ No newline at end of file diff --git a/src/styles/style.scss b/src/styles/style.scss index 642a803..12ccdb2 100644 --- a/src/styles/style.scss +++ b/src/styles/style.scss @@ -13,4 +13,5 @@ @use "search"; @use "theme"; @use "toc"; +@use "sns"; @use "typed-text"; \ No newline at end of file diff --git a/templates/index.html b/templates/index.html index 5dc889f..a914474 100644 --- a/templates/index.html +++ b/templates/index.html @@ -8,6 +8,9 @@

+
+ +
diff --git a/templates/modules/header.html b/templates/modules/header.html index dd036f2..c5eb9cd 100644 --- a/templates/modules/header.html +++ b/templates/modules/header.html @@ -11,36 +11,36 @@ type="button" th:if="${pluginFinder.available('PluginSearchWidget')}" onclick="SearchWidget.open()"> - + \ No newline at end of file