[feat] 完成了一些个性化修改。

1. 新增引用文字颜色和文章标题时间颜色配置,能够单独修改主页文章时间以及文章引用部分的字体颜色。
2. 修改主题名称
3. 页头竖线修改成斜线
4. 菜单栏父菜单整个都会触发下拉菜单栏
5. 主页文章在右侧可以显示封面
This commit is contained in:
2026-08-25 17:15:05 +08:00
parent f35d919733
commit 9c1d9f8f85
10 changed files with 154 additions and 74 deletions
+10
View File
@@ -566,6 +566,16 @@ spec:
key: scheme-code-background key: scheme-code-background
name: code_background name: code_background
label: 代码背景颜色 label: 代码背景颜色
- $formkit: color
if: "$value.advanced === true"
key: scheme-blockquote-text
name: blockquote_text
label: 引用文字颜色
- $formkit: color
if: "$value.advanced === true"
key: scheme-post-title-time
name: post_title_time
label: 文章标题时间颜色
- group: global_style - group: global_style
label: 全局样式 label: 全局样式
formSchema: formSchema:
+2 -2
View File
@@ -92,10 +92,10 @@
&::after { &::after {
content: ""; content: "";
background: repeating-linear-gradient(90deg, var(--color-theme-control), var(--color-theme-control) var(--width-theme-border), transparent 0, transparent calc(var(--size-theme-font) * 0.625)); background: repeating-linear-gradient(135deg, var(--color-theme-control), var(--color-theme-control) var(--width-theme-border), transparent 0, transparent calc(var(--size-theme-font) * 0.625));
display: block; display: block;
width: 100%; width: 100%;
right: calc(var(--size-theme-font) * 0.625); right: calc(var(--size-theme-font) * 0.996);
} }
a { a {
+2 -1
View File
@@ -442,6 +442,7 @@ blockquote {
border-left: var(--width-theme-border) var(--style-theme-border) var(--color-theme-border-accent); border-left: var(--width-theme-border) var(--style-theme-border) var(--color-theme-border-accent);
margin: calc(var(--size-theme-font) * 0.625) 0 calc(var(--size-theme-font) * 0.625) 0; margin: calc(var(--size-theme-font) * 0.625) 0 calc(var(--size-theme-font) * 0.625) 0;
padding: calc(var(--size-theme-font) * 0.625) calc(var(--size-theme-font) * 1.25); padding: calc(var(--size-theme-font) * 0.625) calc(var(--size-theme-font) * 1.25);
color: var(--color-theme-blockquote-text);
} }
blockquote p:first-child { blockquote p:first-child {
@@ -504,7 +505,7 @@ blockquote.twitter-tweet {
position: relative; position: relative;
background: var(--color-theme-background); background: var(--color-theme-background);
font: inherit; font: inherit;
color: inherit; color: var(--color-theme-blockquote-text);
border: calc(var(--width-theme-border) / 2) var(--style-theme-border) var(--color-theme-border-accent); border: calc(var(--width-theme-border) / 2) var(--style-theme-border) var(--color-theme-border-accent);
padding-top: calc(var(--size-theme-font) * 3.75); padding-top: calc(var(--size-theme-font) * 3.75);
} }
+14 -20
View File
@@ -86,25 +86,23 @@
} }
} }
.menu-wrapper {
display: flex;
align-items: center;
cursor: pointer;
> a {
text-decoration: none;
color: var(--color-theme-navigation);
}
}
.menu-trigger { .menu-trigger {
all: unset;
cursor: pointer; cursor: pointer;
background-color: var(--color-theme-background); background-color: var(--color-theme-background);
margin-right: 0; margin-left: calc(var(--size-theme-font) * 0.3125);
padding-left: calc(var(--size-theme-font) * 0.3125);
padding-right: calc(var(--size-theme-font) * 0.3125);
color: var(--color-theme-navigation); color: var(--color-theme-navigation);
user-select: none; user-select: none;
border: none;
display: inline-flex;
@media (max-width: $phone-max-width) {
padding-left: calc(var(--size-theme-font) * 0.625);
padding-right: calc(var(--size-theme-font) * 0.625);
margin-bottom: 0;
outline: none;
-webkit-tap-highlight-color: transparent;
}
} }
.menu-dropdown { .menu-dropdown {
@@ -136,12 +134,8 @@
text-decoration: none; text-decoration: none;
} }
.sub-menu { .menu:hover .menu-dropdown,
display: flex; .menu:active .menu-dropdown {
}
.sub-menu:hover .menu-dropdown,
.sub-menu:active .menu-dropdown {
display: flex; display: flex;
opacity: 1; opacity: 1;
visibility: visible; visibility: visible;
+56
View File
@@ -27,6 +27,49 @@
padding: calc(var(--size-theme-font) * 1.5) 0; padding: calc(var(--size-theme-font) * 1.5) 0;
} }
.post-wrapper {
display: flex;
gap: calc(var(--size-theme-font) * 1.5);
align-items: stretch;
}
.post-content-wrapper {
flex: 1;
min-width: 0;
}
.post-cover-wrapper {
flex-shrink: 0;
width: calc(var(--size-theme-font) * 10);
height: calc(var(--size-theme-font) * 10);
overflow: hidden;
border-radius: calc(var(--size-theme-font) * 0.125);
}
.post-cover-image {
width: 100%;
height: 100%;
object-fit: cover;
margin: 0;
transition: transform 0.3s ease;
}
.post-cover-wrapper:hover .post-cover-image {
transform: scale(1.05);
}
@media (max-width: $phone-max-width) {
.post-wrapper {
flex-direction: column-reverse;
gap: calc(var(--size-theme-font) * 0.75);
}
.post-cover-wrapper {
width: 100%;
height: calc(var(--size-theme-font) * 8);
}
}
.post-meta { .post-meta {
font-size: calc(var(--size-theme-font) * 0.96); font-size: calc(var(--size-theme-font) * 0.96);
margin-bottom: calc(var(--size-theme-font) * 0.3125); margin-bottom: calc(var(--size-theme-font) * 0.3125);
@@ -40,6 +83,19 @@
margin-right: 1ch; margin-right: 1ch;
} }
.post-title-time {
font-size: calc(var(--size-theme-font) * 0.96);
margin-bottom: calc(var(--size-theme-font) * 0.3125);
color: var(--color-theme-post-title-time);
}
.post-title-time > *:not(:first-child):not(:empty)::before {
content: var(--content-theme-post-meta-divider);
color: var(--color-theme-post-title-time);
display: inline-block;
margin-right: 1ch;
}
.post-title { .post-title {
position: relative; position: relative;
color: var(--color-theme-text-accent); color: var(--color-theme-text-accent);
+1
View File
@@ -26,6 +26,7 @@
--color-theme-code-text: var(--color-theme-text); --color-theme-code-text: var(--color-theme-text);
--color-theme-code-background: var(--color-theme-surface-strong); --color-theme-code-background: var(--color-theme-surface-strong);
--color-theme-caret: #970b16; --color-theme-caret: #970b16;
--color-theme-blockquote-text: var(--color-theme-text-secondary);
} }
html[data-theme-color-scheme] { html[data-theme-color-scheme] {
+35 -25
View File
@@ -17,32 +17,42 @@
</section> </section>
<section class="posts"> <section class="posts">
<article class="post on-list" th:each="post : ${posts.items}"> <article class="post on-list" th:each="post : ${posts.items}">
<header> <div class="post-wrapper">
<h2 class="post-title"> <div class="post-content-wrapper">
<span class="pin" th:classappend="${theme.config?.index_page?.pin_pos}" th:if="${post.spec.pinned} and ${theme.config?.index_page?.show_pin}"> <header>
<svg class="icon-regular" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <h2 class="post-title">
<path fill="currentColor" d="M5 2h14a1 1 0 0 1 1 1v19.143a.5.5 0 0 1-.766.424L12 18.03l-7.234 4.536A.5.5 0 0 1 4 22.143V3a1 1 0 0 1 1-1m13 2H6v15.432l6-3.761l6 3.761z" /> <span class="pin" th:classappend="${theme.config?.index_page?.pin_pos}" th:if="${post.spec.pinned} and ${theme.config?.index_page?.show_pin}">
</svg> <svg class="icon-regular" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
<svg class="icon-pixel" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <path fill="currentColor" d="M5 2h14a1 1 0 0 1 1 1v19.143a.5.5 0 0 1-.766.424L12 18.03l-7.234 4.536A.5.5 0 0 1 4 22.143V3a1 1 0 0 1 1-1m13 2H6v15.432l6-3.761l6 3.761z" />
<path fill="currentColor" d="M18 2H6v2h12v16h-2v-2h-2v-2h-4v2H8v2H6V2H4v20h4v-2h2v-2h4v2h2v2h4V2z" /> </svg>
</svg> <svg class="icon-pixel" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
</span> <path fill="currentColor" d="M18 2H6v2h12v16h-2v-2h-2v-2h-4v2H8v2H6V2H4v20h4v-2h2v-2h4v2h2v2h4V2z" />
<a data-pjax th:text="${post.spec.title}" th:href="@{${post.status.permalink}}">Post Title</a> </svg>
</h2> </span>
<div class="post-meta"> <a data-pjax th:text="${post.spec.title}" th:href="@{${post.status.permalink}}">Post Title</a>
<time class="post-date" </h2>
th:text="${#dates.format(post.spec.publishTime, '__${theme.config.general.time_style == 'custom' ? <div class="post-title-time">
theme.config.general.custom_time_style : theme.config.general.time_style}__')}">Publish Time</time> <time class="post-date"
<span class="post-author" th:text="${#dates.format(post.spec.publishTime, '__${theme.config.general.time_style == 'custom' ?
th:with="contributor = ${post.contributors[0]}" theme.config.general.custom_time_style : theme.config.general.time_style}__')}">Publish Time</time>
th:text="${contributor.displayName}">Author</span><th:block th:replace="~{modules/tag-list(post = ${post}, show = ${theme.config.index_page.show_tags})}"/> <span class="post-author"
th:with="contributor = ${post.contributors[0]}"
th:text="${contributor.displayName}">Author</span>
<th:block th:replace="~{modules/tag-list(post = ${post}, show = ${theme.config.index_page.show_tags})}"/>
</div>
</header>
<div class="post-excerpt">
<span th:text="${post.status.excerpt}">Post Excerpt...</span>
</div>
</div>
<div class="post-cover-wrapper" th:if="${post.spec.cover}">
<img class="post-cover-image"
th:src="${post.spec.cover}"
th:srcset="|${thumbnail.gen(post.spec.cover, 's')} 400w, ${thumbnail.gen(post.spec.cover, 'm')} 800w, ${thumbnail.gen(post.spec.cover, 'l')} 1200w|"
sizes="(max-width: 800px) 100vw, 400px"
th:alt="${post.spec.title}"
loading="lazy"/>
</div> </div>
</header>
<div class="post-excerpt">
<span th:text="${post.status.excerpt}">Post Excerpt...</span>
</div>
<div>
<a data-pjax class="read-more button inline" th:href="@{${post.status.permalink}}" th:text="#{page.post.more} + ' >'">READ MORE ></a>
</div> </div>
</article> </article>
</section> </section>
+8
View File
@@ -147,6 +147,14 @@
[# th:if="${not #strings.isEmpty(scheme.code_background)}"] [# th:if="${not #strings.isEmpty(scheme.code_background)}"]
--color-theme-code-background: [(${scheme.code_background})]; --color-theme-code-background: [(${scheme.code_background})];
[/] [/]
[# th:if="${not #strings.isEmpty(scheme.blockquote_text)}"]
--color-theme-blockquote-text: [(${scheme.blockquote_text})];
[/]
[# th:if="${not #strings.isEmpty(scheme.post_title_time)}"]
--color-theme-post-title-time: [(${scheme.post_title_time})];
[/]
} }
[/] [/]
</style> </style>
+16 -16
View File
@@ -218,23 +218,23 @@
</div> </div>
<div th:if="${not #lists.isEmpty(menuItem.children)}" class="menu"> <div th:if="${not #lists.isEmpty(menuItem.children)}" class="menu">
<a data-pjax <div class="menu-wrapper">
th:href="@{${menuItem.status.href}}" <a data-pjax
th:target="${menuItem.spec.target?.value}"> th:href="@{${menuItem.status.href}}"
<span th:text="${menuItem.status.displayName}"></span> th:target="${menuItem.spec.target?.value}">
</a> <span th:text="${menuItem.status.displayName}"></span>
<div class="sub-menu"> </a>
<div class="menu-trigger">▾</div> <span class="menu-trigger">▾</span>
<ul class="menu-dropdown">
<li th:each="childMenuItem : ${menuItem.children}">
<a data-pjax
th:href="@{${childMenuItem.status.href}}"
th:target="${childMenuItem.spec.target?.value}">
<span th:text="${childMenuItem.status.displayName}"></span>
</a>
</li>
</ul>
</div> </div>
<ul class="menu-dropdown">
<li th:each="childMenuItem : ${menuItem.children}">
<a data-pjax
th:href="@{${childMenuItem.status.href}}"
th:target="${childMenuItem.spec.target?.value}">
<span th:text="${childMenuItem.status.displayName}"></span>
</a>
</li>
</ul>
</div> </div>
</li> </li>
</ul> </ul>
+10 -10
View File
@@ -1,23 +1,23 @@
apiVersion: theme.halo.run/v1alpha1 apiVersion: theme.halo.run/v1alpha1
kind: Theme kind: Theme
metadata: metadata:
name: theme-terminal-ez name: theme-terminal-witcher
annotations: annotations:
"store.halo.run/app-id": "app-ehsrxtbn" "store.halo.run/app-id": "app-ehsrxtbn"
spec: spec:
displayName: Terminal-EZ displayName: Terminal-Witcher
author: author:
name: Erzbir name: WitcherCheung
website: https://erzbir.com website: https://witchercheung.cn
description: 一款简洁复古的 Halo 主题 / A simple, retro theme for Halo description: 一款简洁复古的 Halo 主题 / A simple, retro theme for Halo
logo: https://halo.run/logo logo: https://halo.run/logo
homepage: https://www.halo.run/store/apps/app-ehsrxtbn homepage: https://www.halo.run/store/apps/app-ehsrxtbn
repo: https://github.com/Erzbir/halo-theme-terminal.git repo: https://github.com/z1178902213/halo-theme-terminal.git
issues: https://github.com/Erzbir/halo-theme-terminal/issues issues: https://github.com/z1178902213/halo-theme-terminal/issues
settingName: "theme-terminal-ez-setting" settingName: "theme-terminal-witcher-setting"
configMapName: "theme-terminal-ez-configMap" configMapName: "theme-terminal-witcher-configMap"
version: 3.0.0 version: 3.1.0
requires: ">=2.22.0" requires: ">=2.22.0"
license: license:
- name: "MIT" - name: "MIT"
url: "https://github.com/Erzbir/halo-theme-terminal/blob/main/LICENSE" url: "https://github.com/z1178902213/halo-theme-terminal/blob/main/LICENSE"