@sugarat/create-theme 0.0.13 → 0.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// 主题独有配置
|
|
2
2
|
import { getThemeConfig } from '@sugarat/theme/node';
|
|
3
3
|
|
|
4
|
-
// 开启RSS
|
|
4
|
+
// 开启RSS支持(RSS配置)
|
|
5
5
|
// import type { Theme } from '@sugarat/theme'
|
|
6
6
|
|
|
7
7
|
// const baseUrl = 'https://sugarat.top'
|
|
@@ -14,14 +14,23 @@ import { getThemeConfig } from '@sugarat/theme/node';
|
|
|
14
14
|
// image: 'https://img.cdn.sugarat.top/mdImg/MTY3NDk5NTE2NzAzMA==674995167030',
|
|
15
15
|
// favicon: 'https://sugarat.top/favicon.ico',
|
|
16
16
|
// }
|
|
17
|
-
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
// 所有配置项,详见文档: https://theme.sugarat.top/
|
|
18
20
|
const blogTheme = getThemeConfig({
|
|
19
|
-
// 主题色修改
|
|
20
|
-
themeColor: 'el-blue',
|
|
21
21
|
// 开启RSS支持
|
|
22
22
|
// RSS,
|
|
23
|
+
|
|
24
|
+
// 默认开启pagefind离线的全文搜索支持(如使用其它的可以设置为false)
|
|
25
|
+
// 如果npx pagefind 时间过长,可以手动将其安装为项目依赖 pnpm add pagefind
|
|
26
|
+
// search: false,
|
|
27
|
+
|
|
28
|
+
// 主题色修改
|
|
29
|
+
themeColor: 'el-blue',
|
|
30
|
+
|
|
23
31
|
// 文章默认作者
|
|
24
32
|
author: '粥里有勺糖',
|
|
33
|
+
|
|
25
34
|
// 友链
|
|
26
35
|
friend: [
|
|
27
36
|
{
|
|
@@ -39,8 +48,8 @@ const blogTheme = getThemeConfig({
|
|
|
39
48
|
url: 'https://vitepress.dev/',
|
|
40
49
|
},
|
|
41
50
|
],
|
|
42
|
-
|
|
43
|
-
|
|
51
|
+
|
|
52
|
+
// 公告
|
|
44
53
|
popover: {
|
|
45
54
|
title: '公告',
|
|
46
55
|
body: [
|
|
@@ -71,6 +71,8 @@ npm i -g pnpm
|
|
|
71
71
|
pnpm dev
|
|
72
72
|
```
|
|
73
73
|
|
|
74
|
+

|
|
75
|
+
|
|
74
76
|
你就会得到一个这样的页面
|
|
75
77
|
|
|
76
78
|

|
|
@@ -79,17 +81,35 @@ pnpm dev
|
|
|
79
81
|
```sh
|
|
80
82
|
pnpm build
|
|
81
83
|
```
|
|
84
|
+

|
|
85
|
+
|
|
86
|
+
默认会开启内置的离线全文搜索(基于 `pagefind` 实现)
|
|
87
|
+
|
|
88
|
+
如果不需要可以在 `docs/.vitepress/blog-theme.ts` 中关闭
|
|
89
|
+
* 如果`npx pagefind` 时间过长,可以手动将其安装为项目依赖 `pnpm add pagefind`
|
|
90
|
+
```ts
|
|
91
|
+
const blogTheme = getThemeConfig({
|
|
92
|
+
// 默认开启pagefind离线的全文搜索支持(如使用其它的可以设置为false)
|
|
93
|
+
// 如果npx pagefind 时间过长,可以手动将其安装为项目依赖 pnpm add pagefind
|
|
94
|
+
search: false,
|
|
95
|
+
});
|
|
96
|
+
```
|
|
82
97
|
|
|
83
98
|
⑤ 预览构建产物
|
|
84
99
|
```sh
|
|
85
100
|
pnpm serve
|
|
86
101
|
```
|
|
87
102
|
|
|
103
|
+

|
|
104
|
+
|
|
88
105
|
## 升级
|
|
89
106
|
|
|
90
107
|
如果主题更新了,升级主题,原项目只需执行如下指令即可
|
|
91
108
|
```sh
|
|
92
109
|
pnpm up @sugarat/theme
|
|
110
|
+
|
|
111
|
+
# 更新 vitepress 版本(通常安装最新的即可,主题包每次更新不出意外都会使用最新的VitePress)
|
|
112
|
+
pnpm add vitepress@latest
|
|
93
113
|
```
|
|
94
114
|
|
|
95
115
|
## 更多
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@element-plus/icons-vue": "^2.1.0",
|
|
12
|
-
"@sugarat/theme": "^0.1.
|
|
12
|
+
"@sugarat/theme": "^0.1.48",
|
|
13
13
|
"element-plus": "^2.3.8",
|
|
14
14
|
"vue": "^3.3.4"
|
|
15
15
|
},
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"devDependencies": {
|
|
20
20
|
"sass": "^1.64.1",
|
|
21
21
|
"typescript": "^5.1.6",
|
|
22
|
-
"vitepress": "1.0.0-rc.
|
|
22
|
+
"vitepress": "1.0.0-rc.14"
|
|
23
23
|
},
|
|
24
24
|
"author": "粥里有勺糖",
|
|
25
25
|
"license": "MIT"
|