From 4c76b9d07609c2909424f643a823733be9f5147f Mon Sep 17 00:00:00 2001 From: rohow Date: Thu, 22 Aug 2024 15:39:06 +0800 Subject: [PATCH] =?UTF-8?q?feat(theme):=20logo=E9=85=8D=E7=BD=AE=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- theme-terminal/settings.yaml | 10 +++++++++ theme-terminal/src/styles/header.scss | 22 ++++++-------------- theme-terminal/src/styles/logo.scss | 22 ++++++++++++++++---- theme-terminal/src/styles/post.scss | 1 + theme-terminal/templates/modules/header.html | 12 +++++------ theme-terminal/templates/modules/layout.html | 4 ++-- theme-terminal/theme.yaml | 2 +- 7 files changed, 44 insertions(+), 29 deletions(-) diff --git a/theme-terminal/settings.yaml b/theme-terminal/settings.yaml index 29c0d38..3a16f67 100644 --- a/theme-terminal/settings.yaml +++ b/theme-terminal/settings.yaml @@ -11,6 +11,16 @@ spec: name: pixel_style label: 像素化风格 help: 开启后,将使用像素风格字体及图标。 + - $formkit: attachment + name: logo + label: logo图片链接 + help: 配置后,将展示在导航栏左侧。 + accepts: + - "image/png" + - $formkit: text + name: title + label: 站点标题 + help: 配置后,将展示站点标题。 - group: index label: 首页设置 formSchema: diff --git a/theme-terminal/src/styles/header.scss b/theme-terminal/src/styles/header.scss index c44e575..b25c458 100644 --- a/theme-terminal/src/styles/header.scss +++ b/theme-terminal/src/styles/header.scss @@ -22,23 +22,13 @@ align-items: center; justify-content: space-between; } - - &__logo { - display: flex; + + .dividing { flex: 1; - - &:after { - content: ''; - background: repeating-linear-gradient(90deg, var(--foreground), var(--foreground) 2px, transparent 0, transparent 16px); - display: block; - width: 100%; - right: 10px; - } - - a { - flex: 0 0 auto; - max-width: 100%; - } + background: repeating-linear-gradient(90deg, var(--foreground), var(--foreground) 2px, transparent 0, transparent 16px); + display: block; + width: 100%; + height: 25px; } .menu { diff --git a/theme-terminal/src/styles/logo.scss b/theme-terminal/src/styles/logo.scss index 67cdfde..c71b09b 100644 --- a/theme-terminal/src/styles/logo.scss +++ b/theme-terminal/src/styles/logo.scss @@ -1,8 +1,22 @@ .logo { display: flex; align-items: center; - text-decoration: none; - background: var(--foreground); - color: var(--background); - padding: 5px 10px; + + .icon { + max-width: 100%; + max-height: 35px; + height: 100%; + font-size: 0; + object-fit: cover; + margin-right: 10px; + } + + .text { + display: flex; + padding: 3px 10px; + color: var(--background); + background: var(--foreground); + text-decoration: none; + margin-right: 16px; + } } diff --git a/theme-terminal/src/styles/post.scss b/theme-terminal/src/styles/post.scss index 1cfad4e..37085a9 100644 --- a/theme-terminal/src/styles/post.scss +++ b/theme-terminal/src/styles/post.scss @@ -92,6 +92,7 @@ &-content { margin-top: 30px; + font-family: Hack, Monaco, Consolas, 'Ubuntu Mono', PingHei, 'PingFang SC', 'Microsoft YaHei', monospace; } &-cover { diff --git a/theme-terminal/templates/modules/header.html b/theme-terminal/templates/modules/header.html index b439024..9886acd 100644 --- a/theme-terminal/templates/modules/header.html +++ b/theme-terminal/templates/modules/header.html @@ -1,11 +1,11 @@ -
+
- + +
- + diff --git a/theme-terminal/theme.yaml b/theme-terminal/theme.yaml index fc192af..f84f098 100644 --- a/theme-terminal/theme.yaml +++ b/theme-terminal/theme.yaml @@ -13,5 +13,5 @@ spec: repo: https://git.dev.cm/theme-terminal settingName: "theme-terminal-setting" configMapName: "theme-terminal-configMap" - version: 1.0.0 + version: 1.0.1 require: ">=2.8.0"