Skip to content

Commit 4cd07bc

Browse files
authored
Merge pull request #330 from xzhuz/refactor/refine-for-halo-2.0
refactor: refine for halo 2.0 > 目前明暗模式似乎刷新页面会丢失设置。 先发布吧,后面在迭代
2 parents 5735fee + e5731b8 commit 4cd07bc

11 files changed

Lines changed: 21 additions & 20 deletions

File tree

settings.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,7 @@ spec:
4949
- $formkit: repeater
5050
name: card_random_cover_list
5151
label: 随机封面图片列表
52-
value:
53-
- url:
52+
value: []
5453
children:
5554
- $formkit: attachment
5655
name: url

templates/archives.html

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!DOCTYPE html>
22
<html
33
xmlns:th="https://www.thymeleaf.org"
4-
th:replace="module/macro :: html(~{::content})"
4+
th:replace="module/macro :: html(title = '归档 - ' + ${site.title}, content = ~{::content})"
55
>
66
<th:block th:fragment="content">
77
<main class="mx-auto" id="container">
@@ -28,9 +28,7 @@
2828
<h2
2929
class="relative mb-5 mt-4 w-full text-center text-4xl leading-loose text-white dark:text-gray-300"
3030
>
31-
<th:block
32-
th:text="${theme.config.title.achieve_title} ? '归档'"
33-
/>
31+
<th:block th:text="${theme.config.title.achieve_title} ? '归档'" />
3432
</h2>
3533
</div>
3634
</header>

templates/categories.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!DOCTYPE html>
22
<html
33
xmlns:th="https://www.thymeleaf.org"
4-
th:replace="module/macro :: html(~{::content})"
4+
th:replace="module/macro :: html(title = '分类 - ' + ${site.title}, content = ~{::content})"
55
>
66
<th:block th:fragment="content">
77
<main class="mx-auto" id="container">

templates/category.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!DOCTYPE html>
22
<html
33
xmlns:th="https://www.thymeleaf.org"
4-
th:replace="module/macro :: html(~{::content})"
4+
th:replace="module/macro :: html(title = '分类:' + ${category.spec.displayName} + ' - ' + ${site.title}, content = ~{::content})"
55
>
66
<th:block th:fragment="content">
77
<main class="mx-auto" id="container">

templates/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!DOCTYPE html>
22
<html
33
xmlns:th="https://www.thymeleaf.org"
4-
th:replace="module/macro :: html(~{::content})"
4+
th:replace="module/macro :: html(title = ${site.title},content = ~{::content})"
55
>
66
<th:block th:fragment="content">
77
<main class="mx-auto" id="container">

templates/links.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!DOCTYPE html>
22
<html
33
xmlns:th="https://www.thymeleaf.org"
4-
th:replace="module/macro :: html(~{::content})"
4+
th:replace="module/macro :: html(title = '友情链接 - ' + ${site.title}, content = ~{::content})"
55
>
66
<th:block th:fragment="content">
77
<main class="mx-auto" id="container">

templates/module/macro.html

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,23 @@
11
<!DOCTYPE html>
22
<html
3-
th:fragment="html (content)"
3+
th:fragment="html (title, content)"
44
lang="zh"
55
class="m-0 h-full p-0 text-base sm:text-sm"
66
>
77
<head>
88
<meta charset="UTF-8" />
9-
<meta name="keywords" content="${meta_keywords!}" />
10-
<meta name="description" content="${meta_description!}" />
119
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
1210
<meta
1311
name="viewport"
1412
content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"
1513
/>
16-
<title th:text="${site.title}"></title>
14+
<title th:text="${title}"></title>
1715
<th:block th:replace="module/styles :: styles" />
1816
<script th:src="@{/assets/js/plugins/jquery.min.js}"></script>
17+
<script
18+
th:if="${theme.config.general.pjax_enabled} and ${pluginFinder.available('PluginCommentWidget')}"
19+
src="/plugins/PluginCommentWidget/assets/static/comment-widget.iife.js"
20+
></script>
1921
</head>
2022
<body class="m-0 h-full p-0 font-sans">
2123
<div class="flex h-full flex-col">

templates/page.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!DOCTYPE html>
22
<html
33
xmlns:th="https://www.thymeleaf.org"
4-
th:replace="module/macro :: html(~{::content})"
4+
th:replace="module/macro :: html(title = ${singlePage.spec.title} + ' - ' + ${site.title}, content = ~{::content})"
55
>
66
<th:block th:fragment="content">
77
<main class="mx-auto" id="container">
@@ -46,6 +46,7 @@
4646
group="content.halo.run"
4747
kind="Post"
4848
th:attr="name=${singlePage.metadata.name}"
49+
colorScheme="localStorage.getItem('theme') || 'dark'"
4950
/>
5051
</div>
5152
</section>

templates/post.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!DOCTYPE html>
22
<html
33
xmlns:th="https://www.thymeleaf.org"
4-
th:replace="module/macro :: html(~{::content})"
4+
th:replace="module/macro :: html(title = ${post.spec.title} + ' - ' + ${site.title}, content = ~{::content})"
55
>
66
<th:block th:fragment="content">
77
<main class="mx-auto" id="container">
@@ -20,7 +20,7 @@
2020
/>
2121
</div>
2222
<div
23-
th:if="${not #strings.isEmpty(post.spec.cover)} or ${theme.config.general.enabled_card_random_cover_list}"
23+
th:if="${#strings.isEmpty(post.spec.cover)} and ${theme.config.general.enabled_card_random_cover_list}"
2424
class="cover-bg absolute bottom-0 left-0 right-0 top-0 opacity-30"
2525
>
2626
<img
@@ -30,7 +30,7 @@
3030
/>
3131
</div>
3232
<div
33-
th:if="${#strings.isEmpty(post.spec.cover)} and ${!theme.config.general.enabled_card_random_cover_list}"
33+
th:if="${#strings.isEmpty(post.spec.cover)} and ${not theme.config.general.enabled_card_random_cover_list}"
3434
class="placeholder-bg"
3535
></div>
3636
<div
@@ -176,6 +176,7 @@
176176
group="content.halo.run"
177177
kind="Post"
178178
th:attr="name=${post.metadata.name}"
179+
colorScheme="localStorage.getItem('theme') || 'dark'"
179180
/>
180181
</div>
181182
</section>

templates/tag.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!DOCTYPE html>
22
<html
33
xmlns:th="https://www.thymeleaf.org"
4-
th:replace="module/macro :: html(~{::content})"
4+
th:replace="module/macro :: html(title = '标签:' + ${tag.spec.displayName} + ' - ' + ${site.title}, content = ~{::content})"
55
>
66
<th:block th:fragment="content">
77
<main class="mx-auto" id="container">

0 commit comments

Comments
 (0)