Skip to content

Commit 4694c9b

Browse files
committed
feat: Add footer style 4,Adjust the font and font size and other styles,Add hidden author or unified author configuration
1 parent 8d79f3c commit 4694c9b

18 files changed

+248
-50
lines changed

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@ build: clean
77
mkdir dist
88
cp -r templates dist
99
cp theme.yaml settings.yaml README.md dist
10+
zip -r dist.zip ./dist
11+
1012

1113
clean:
1214
echo "Clean dist folder"
1315
rm -rf dist
16+
rm -rf dist.zip

annotation-settings.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
spec:
2+
targetRef:
3+
group: content.halo.run
4+
kind: Category
5+
formSchema:
6+
- $formkit: "color"
7+
name: "color"
8+
label: "字体颜色"
9+
apiVersion: v1alpha1
10+
kind: AnnotationSetting
11+
metadata:
12+
generateName: annotation-

settings.yaml

Lines changed: 39 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,33 @@ spec:
2828
value: true
2929
- label: 隐藏
3030
value: false
31+
- $formkit: radio
32+
name: hide_avatar
33+
id: hide_avatar
34+
key: hide_avatar
35+
label: 隐藏作者头像
36+
value: false
37+
options:
38+
- label:
39+
value: true
40+
- label:
41+
value: false
42+
- $formkit: radio
43+
name: hide_author
44+
id: hide_author
45+
key: hide_author
46+
label: 隐藏作者名称
47+
value: false
48+
options:
49+
- label:
50+
value: true
51+
- label:
52+
value: false
53+
- $formkit: text
54+
if: "$get(hide_author).value === false"
55+
name: common_author
56+
label: 统一作者名称
57+
help: "为空显示原文章作者"
3158

3259
- group: banner
3360
label: Banner
@@ -102,7 +129,7 @@ spec:
102129
key: module_one
103130
value: 模块一
104131
label: 模块一名称
105-
help: 默认显示主菜单项
132+
help: 默认显示前四个分类
106133
- $formkit: select
107134
if: "$get(index_menu).value === true"
108135
name: module_one_layout
@@ -115,7 +142,7 @@ spec:
115142
value: 4
116143
- label: 网格(一行五列)
117144
value: 5
118-
help: 默认显示一行
145+
help: 默认显示一行四列
119146
- $formkit: radio
120147
name: index_theme
121148
id: index_theme
@@ -327,6 +354,8 @@ spec:
327354
value: style_2
328355
- label: 风格三
329356
value: style_3
357+
- label: 风格四
358+
value: style_4
330359
- $formkit: attachment
331360
name: logo
332361
label: Logo
@@ -342,7 +371,7 @@ spec:
342371
name: slogan
343372
id: slogan
344373
key: slogan
345-
if: "$get(style).value === style_2 || $get(style).value === style_1"
374+
if: "$get(style).value !== style_3"
346375
label: 标语
347376

348377
- $formkit: menuRadio
@@ -353,7 +382,7 @@ spec:
353382
label: 右侧菜单
354383

355384
- $formkit: repeater
356-
if: "$get(style).value === style_2 || $get(style).value === style_1"
385+
if: "$get(style).value !== style_3"
357386
name: menus
358387
id: menus
359388
key: menus
@@ -364,6 +393,12 @@ spec:
364393
name: name
365394
label: 菜单
366395
validation: "required"
396+
397+
- $formkit: attachment
398+
if: "$get(style).value === style_4"
399+
name: qrcode
400+
label: Qrcode
401+
help: 关注二维码
367402

368403
- $formkit: repeater
369404
name: social_media

src/styles/main.css

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,3 @@ body {
8181
}
8282

8383
/*a标签增加指上下划线*/
84-
85-
.prose h1 {
86-
font-size: 2em !important;
87-
}

tailwind.config.cjs

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/** @type {import('tailwindcss').Config} */
22
const { Icons } = require("tailwindcss-plugin-icons");
3+
const plugin = require('tailwindcss/plugin')
34
module.exports = {
45
content: ["./templates/**/*.html", "./src/main.ts"],
56
darkMode: "class",
@@ -9,6 +10,64 @@ module.exports = {
910
7: "7",
1011
8: "8",
1112
},
13+
typography: {
14+
DEFAULT: {
15+
css: {
16+
h1 : {
17+
marginTop: '0.25em !important',
18+
marginBottom: '0.25em !important',
19+
},
20+
h2 : {
21+
marginTop: '0.25em !important',
22+
marginBottom: '0.25em !important',
23+
},
24+
h3 : {
25+
marginTop: '0.25em !important',
26+
marginBottom: '0.25em !important',
27+
},
28+
h4 : {
29+
marginTop: '0.25em !important',
30+
marginBottom: '0.25em !important',
31+
},
32+
ul : {
33+
marginTop: '0.25em !important',
34+
marginBottom: '0.25em !important',
35+
},
36+
li : {
37+
marginTop: '0.25em !important',
38+
marginBottom: '0.25em !important',
39+
},
40+
dl : {
41+
marginTop: '0.25em !important',
42+
marginBottom: '0.25em !important',
43+
},
44+
p : {
45+
marginTop: '0.25em !important',
46+
marginBottom: '0.25em !important',
47+
},
48+
img : {
49+
marginTop: '0.5em !important',
50+
marginBottom: '0.5em !important',
51+
},
52+
dd : {
53+
marginTop: '0.25em !important',
54+
marginBottom: '0.25em !important',
55+
},
56+
ol : {
57+
marginTop: '0.25em !important',
58+
marginBottom: '0.25em !important',
59+
},
60+
pre : {
61+
marginTop: '0.25em !important',
62+
marginBottom: '0.25em !important',
63+
},
64+
hr : {
65+
marginTop: '1.25em !important',
66+
marginBottom: '1.25em !important',
67+
},
68+
},
69+
},
70+
},
1271
},
1372
container: {
1473
padding: {

templates/archives.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
id="post-list"
1111
th:if="${archives.total gt 0}"
1212
th:with="archivesItems=${archives.items},list_layout=${theme.config.layout.post_list_layout}"
13-
class="mt-6 grid grid-cols-1 gap-6"
13+
class="mt-10 grid grid-cols-1 gap-6"
1414
th:classappend="${list_layout == 'grid_3' ? 'md:grid-cols-2 xl:grid-cols-3' : ''} + ' ' + ${list_layout == 'grid_2' ? 'md:grid-cols-2' : ''}"
1515
>
1616
<th:block th:each="archive : ${archivesItems}">

templates/assets/dist/style.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

templates/categories.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
id="post-list"
1212
th:if="${posts.total gt 0}"
1313
th:with="postItems=${posts.items},list_layout=${theme.config.layout.post_list_layout}"
14-
class="mt-6 grid grid-cols-1 gap-6"
14+
class="mt-10 grid grid-cols-1 gap-6"
1515
th:classappend="${list_layout == 'grid_3' ? 'md:grid-cols-2 xl:grid-cols-3' : ''} + ' ' + ${list_layout == 'grid_2' ? 'md:grid-cols-2' : ''}"
1616
>
1717
<th:block th:each="post : ${postItems}">

templates/category.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
id="post-list"
1111
th:if="${posts.total gt 0}"
1212
th:with="postItems=${posts.items},list_layout=${theme.config.layout.post_list_layout}"
13-
class="mt-6 grid grid-cols-1 gap-6"
13+
class="mt-10 grid grid-cols-1 gap-6"
1414
th:classappend="${list_layout == 'grid_3' ? 'md:grid-cols-2 xl:grid-cols-3' : ''} + ' ' + ${list_layout == 'grid_2' ? 'md:grid-cols-2' : ''}"
1515
>
1616
<th:block th:each="post : ${postItems}">

templates/modules/featured-post-card.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,16 @@
4141
<p class="font-sm font-light line-clamp-6 dark:text-zinc-200" th:text="${post.status.excerpt}"></p>
4242
<div class="mt-4 flex flex-1 items-center justify-start gap-2">
4343
<img
44+
th:if="${not theme.config.layout.hide_avatar}"
4445
th:src="${post.owner.avatar ?: #theme.assets('/images/default-avatar.svg')}"
4546
th:title="${post.owner.displayName}"
4647
th:alt="${post.owner.displayName}"
4748
class="h-8 w-8 rounded-full border drop-shadow-sm dark:border-zinc-700"
4849
/>
4950
<span
5051
class="text-sm font-medium text-zinc-900 dark:text-zinc-100"
51-
th:if="${#strings.isEmpty(post.owner.avatar)}"
52-
th:text="${post.owner.displayName}"
52+
th:if="${not theme.config.layout.hide_author}"
53+
th:text="${not #strings.isEmpty(theme.config.layout.common_author) ? theme.config.layout.common_author : post.owner.displayName}"
5354
></span>
5455
<span
5556
class="text-sm tabular-nums text-zinc-600 dark:text-zinc-300"

0 commit comments

Comments
 (0)