Skip to content

Commit f111437

Browse files
feat(theme/ci): 增加更改历史功能,修复页面元素,修复语言'从cn替换到zh-CN' (#67)
build(deps): bump sass from 1.77.4 to 1.77.5 (#68) Bumps [sass](https://github.com/sass/dart-sass) from 1.77.4 to 1.77.5. - [Release notes](https://github.com/sass/dart-sass/releases) - [Changelog](https://github.com/sass/dart-sass/blob/main/CHANGELOG.md) - [Commits](sass/dart-sass@1.77.4...1.77.5) --- updated-dependencies: - dependency-name: sass dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
1 parent c8251e6 commit f111437

File tree

14 files changed

+1711
-903
lines changed

14 files changed

+1711
-903
lines changed

.github/workflows/Build-Docs.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Build Docs
2+
3+
on:
4+
push:
5+
branches:
6+
- 'main'
7+
8+
jobs:
9+
build:
10+
name: Build
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: 拉取代码
14+
uses: actions/checkout@v4
15+
with:
16+
fetch-depth: 0

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@ TODOs.md
1212
pnpm-global
1313
docs/.vitepress/cache
1414
package-lock.json
15-
cache
15+
cache
16+
.vercel

.prettierignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,4 @@ cache
44
template
55
temp
66
!CHANGELOG.md
7-
.temp
8-
玄学宝典
7+
.temp

.prettierrc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
semi: false
22
singleQuote: true
3-
printWidth: 120
3+
printWidth: 80
44
trailingComma: none

.vitepress/config.mts

Lines changed: 53 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,37 @@
11
import { defineConfig } from 'vitepress'
22
import { nav, sidebar, head, socialLinks } from './configs'
33
import footnote_plugin from 'markdown-it-footnote'
4+
import {
5+
GitChangelog,
6+
GitChangelogMarkdownSection
7+
} from '@nolebase/vitepress-plugin-git-changelog/vite'
48

59
export default defineConfig({
610
// 站点名称
711
title: '玄学宝典',
812

913
// 站点语言
10-
lang: 'cn',
14+
lang: 'zh-CN',
1115

1216
// 网站头部
1317
head,
1418

1519
// 站点介绍
16-
description: '',
20+
description: '玄学宝典 - 中华传统五术书籍(山医命相卜)/传世经典著作',
1721

18-
// 上次更新时间戳
19-
lastUpdated: true,
20-
21-
// 开启后网址后缀无'html'
22-
cleanUrls: true,
22+
//'force-dark'强制开启深色模式 false强制开启浅色模式
23+
appearance: 'force-dark',
2324

24-
// 源目录
25-
srcDir: 'src',
25+
// 站点地图
26+
sitemap: {
27+
hostname: 'https://xx.theovan.cn'
28+
},
2629

2730
// markdown-it插件配置
2831
markdown: {
2932
theme: {
30-
light: 'github-light',
31-
dark: 'github-dark-dimmed'
33+
light: 'catppuccin-latte',
34+
dark: 'dracula-soft'
3235
},
3336
container: {
3437
tipLabel: '提示',
@@ -42,18 +45,30 @@ export default defineConfig({
4245
}
4346
},
4447

45-
//'force-dark'强制开启深色模式 false强制开启浅色模式
46-
appearance: 'force-dark',
47-
48-
// 站点地图
49-
sitemap: {
50-
hostname: 'https://xx.theovan.cn'
48+
// 插件配置
49+
vite: {
50+
plugins: [
51+
GitChangelog({
52+
// 填写在此处填写您的仓库链接
53+
repoURL: () => 'https://github.com/Theo-messi/Metaphysical-Book'
54+
}),
55+
GitChangelogMarkdownSection()
56+
]
5157
},
5258

59+
// 源目录
60+
srcDir: 'src',
61+
62+
// 上次更新时间戳
63+
lastUpdated: true,
64+
65+
// 开启后网址后缀无'html'
66+
cleanUrls: true,
67+
5368
// 主题配置
5469
themeConfig: {
5570
// // logo
56-
logo: 'https://m.theovan.cn/avatar.png',
71+
logo: { src: 'https://m.theovan.cn/avatar.png', width: 24, height: 24 },
5772

5873
// 社交链接
5974
socialLinks,
@@ -63,7 +78,8 @@ export default defineConfig({
6378

6479
// GitHub编辑页面
6580
editLink: {
66-
pattern: 'https://github.com/Theo-messi/Metaphysical-Book/blob/main/src/:path',
81+
pattern:
82+
'https://github.com/Theo-messi/Metaphysical-Book/blob/main/src/:path',
6783
text: '为此页提供修改建议'
6884
},
6985

@@ -72,23 +88,37 @@ export default defineConfig({
7288
outlineTitle: '本页目录', // 目录文本
7389

7490
// 上次更新
75-
lastUpdated: { text: '上次更新' },
91+
lastUpdated: {
92+
text: '最后更新于',
93+
formatOptions: {
94+
dateStyle: 'full',
95+
timeStyle: 'full',
96+
hourCycle: 'h24'
97+
}
98+
},
7699

77100
// 文章翻页
78101
docFooter: {
79102
prev: '上一篇',
80103
next: '下一篇'
81104
},
82105

83-
// 移动端 - 外观
84-
darkModeSwitchLabel: '外观',
85-
86106
// 移动端 - 返回顶部
87107
returnToTopLabel: '返回顶部',
88108

89109
// 移动端 - menu
90110
sidebarMenuLabel: '文章',
91111

112+
// 主题模式切换
113+
lightModeSwitchTitle: '切换到浅色模式',
114+
darkModeSwitchTitle: '切换到深色模式',
115+
darkModeSwitchLabel: '主题模式',
116+
117+
// markdown 外部链接图标
118+
externalLinkIcon: true,
119+
// 语言切换
120+
langMenuLabel: '切换语言',
121+
92122
// 导航栏
93123
nav,
94124

.vitepress/configs/head.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export const head: HeadConfig[] = [
1010
// 设置OG类型
1111
['meta', { name: 'og:type', content: 'website' }],
1212
// 设置OG语言
13-
['meta', { name: 'og:locale', content: 'cn' }],
13+
['meta', { name: 'og:locale', content: 'zh-CN' }],
1414
// 设置OG站点名称
1515
['meta', { name: 'og:site_name', content: '玄学宝典' }],
1616
// 设置OG图片

.vitepress/theme/components/pendant.vue

Lines changed: 78 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const asideSponsors = computed(() => {
2020
// url: sponsor.href,
2121
// img: sponsor.imgSrcLight
2222
// }))
23-
// }
23+
// },
2424
// {
2525
// size: 'xmini',
2626
// items: sponsors.bronze.map((sponsor: Sponsor) => ({
@@ -35,15 +35,23 @@ const asideSponsors = computed(() => {
3535

3636
<template>
3737
<VPDocAsideSponsors :data="asideSponsors" />
38-
39-
<a class="banner mp" href="https://github.com/sponsors/Theo-messi" target="_blank">
40-
<img width="22" height="22" src="https://theovan.xyz/爱心.png" />
38+
<a
39+
class="banner mp"
40+
href="https://fbinv01.fbaff.cc/auth/register?code=RZP3"
41+
target="_blank"
42+
>
43+
<!-- <img
44+
width="22"
45+
height="22"
46+
src="https://flyingbirdlimo.com/wp-content/uploads/2022/03/Flying-Bird-Logo-cropped.png"
47+
/> -->
4148
<span>
42-
<!-- <p class="extra-info">Sponsor for me</p> -->
43-
<p class="heading">为我赞助</p>
44-
<!-- <p class="extra-info">Sponsor now!</p> -->
49+
<p class="Activity">FlyingBird 618活动来了</p>
50+
<p class="extra">月付 85折 优惠码:2461885</p>
51+
<p class="extra">年付 64折 优惠码:2461880</p>
4552
</span>
4653
</a>
54+
4755
<a class="banner mp" href="https://theovan.cn/" target="_blank">
4856
<img width="22" height="22" src="https://m.theovan.cn/avatar.png" />
4957
<span>
@@ -53,21 +61,45 @@ const asideSponsors = computed(() => {
5361
</span>
5462
</a>
5563
<a class="banner mp" href="https://share.theovan.cn/" target="_blank">
56-
<img width="22" height="22" src="https://m.theovan.cn/docs/202405101119004.png" />
64+
<img
65+
width="22"
66+
height="22"
67+
src="https://m.theovan.cn/docs/202405101119004.png"
68+
/>
5769
<span>
5870
<p class="extra-info">快速获取热门影视资源</p>
5971
<p class="heading">阿里云盘资源分享</p>
6072
<p class="extra-info">转存观看!</p>
6173
</span>
6274
</a>
63-
<a class="banner mp" href="https://theovan.xyz/serve/sharing/Account-sharing-guide" target="_blank">
64-
<img width="22" height="22" src="https://cdn.iconscout.com/icon/free/png-256/free-netflix-2296042-1912001.png" />
75+
<a
76+
class="banner mp"
77+
href="https://theovan.xyz/serve/sharing/Account-sharing-guide"
78+
target="_blank"
79+
>
80+
<img
81+
width="22"
82+
height="22"
83+
src="https://cdn.iconscout.com/icon/free/png-256/free-netflix-2296042-1912001.png"
84+
/>
6585
<span>
6686
<p class="extra-info">流媒体账号合租</p>
6787
<p class="heading">流媒体帐号合租</p>
6888
<p class="extra-info">转存观看!</p>
6989
</span>
7090
</a>
91+
<a
92+
class="banner mp"
93+
href="https://github.com/sponsors/Theo-messi"
94+
target="_blank"
95+
>
96+
<img width="22" height="22" src="https://theovan.cn/爱心.png" />
97+
<span>
98+
<!-- <p class="extra-info">Sponsor for me</p> -->
99+
<p class="heading">为我赞助</p>
100+
<!-- <p class="extra-info">Sponsor now!</p> -->
101+
</span>
102+
</a>
71103
</template>
72104

73105
<style scoped>
@@ -105,8 +137,8 @@ const asideSponsors = computed(() => {
105137
justify-content: center;
106138
width: 100%;
107139
gap: 1rem;
108-
background-color: var(--vp-c-bg-alt);
109-
border: 2px solid var(--vp-c-bg-alt);
140+
background-color: var(--vp-c-bg-soft);
141+
border: 2px solid var(--vp-c-bg-soft);
110142
transition: border-color 0.5s;
111143
}
112144
@@ -138,18 +170,50 @@ const asideSponsors = computed(() => {
138170
transition: opacity 0.5s;
139171
}
140172
173+
.banner .extra {
174+
color: var(--vp-c-text-3);
175+
/* opacity: 0; */
176+
font-size: 0.7rem;
177+
padding-left: 0.1rem;
178+
/* transition: opacity 0.5s; */
179+
}
180+
141181
.banner .heading {
142-
background-image: linear-gradient(120deg, var(--vp-c-brand-3) 32%, var(--vp-c-brand-2), var(--vp-c-brand-1));
182+
background-image: linear-gradient(
183+
120deg,
184+
var(--vp-c-brand-3) 32%,
185+
var(--vp-c-brand-2),
186+
var(--vp-c-brand-1)
187+
);
188+
background-clip: text;
189+
-webkit-background-clip: text;
190+
-webkit-text-fill-color: transparent;
191+
}
192+
.banner .Activity {
193+
background-image: linear-gradient(120deg, #b047ff 16%, #646cff, #747bff);
143194
background-clip: text;
144195
-webkit-background-clip: text;
145196
-webkit-text-fill-color: transparent;
146197
}
147198
148199
.banner.mp .heading {
149-
background-image: linear-gradient(120deg, var(--vp-c-brand-3) 32%, var(--vp-c-brand-2), var(--vp-c-brand-1));
200+
background-image: linear-gradient(
201+
120deg,
202+
var(--vp-c-brand-3) 32%,
203+
var(--vp-c-brand-2),
204+
var(--vp-c-brand-1)
205+
);
206+
}
207+
208+
.banner.mp .Activity {
209+
background-image: linear-gradient(120deg, #b047ff 16%, #646cff, #747bff);
150210
}
151211
152212
.banner:hover .extra-info {
153213
opacity: 0.9;
154214
}
215+
216+
.banner:hover .extra {
217+
opacity: 0.9;
218+
}
155219
</style>

.vitepress/theme/index.ts

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@ import { inject } from '@vercel/analytics'
44
import googleAnalytics from 'vitepress-plugin-google-analytics'
55
import { h } from 'vue'
66
import AsideSponsors from './components/pendant.vue'
7+
import { NolebaseGitChangelogPlugin } from '@nolebase/vitepress-plugin-git-changelog/client'
78

89
import './styles/index.css'
10+
import '@nolebase/vitepress-plugin-git-changelog/client/style.css'
911
inject()
1012

1113
// 导出默认主题
@@ -16,7 +18,28 @@ export default {
1618
'aside-ads-before': () => h(AsideSponsors)
1719
})
1820
},
19-
enhanceApp: (ctx) => {
20-
googleAnalytics({ id: 'G-5SHLV23EGQ' })
21+
enhanceApp: ({ app }, ctx) => {
22+
googleAnalytics({ id: 'G-5SHLV23EGQ' }),
23+
app.use(NolebaseGitChangelogPlugin, {
24+
mapAuthors: [
25+
{
26+
name: 'Theo',
27+
username: 'Theo-messi',
28+
mapByNameAliases: ['Theo', 'vanhiupun'],
29+
mapByEmailAliases: [
30+
31+
32+
33+
]
34+
},
35+
{
36+
name: 'dependabot',
37+
username: 'dependabot',
38+
mapByEmailAliases: [
39+
'49699333+dependabot[bot]@users.noreply.github.com'
40+
]
41+
}
42+
]
43+
})
2144
}
2245
}

0 commit comments

Comments
 (0)