Skip to content
This repository was archived by the owner on Aug 25, 2025. It is now read-only.

Commit 2fbbc1c

Browse files
refactor: update to latest vuepress usage (#31)
Co-authored-by: Hantong Chen <70561268+cxw620@users.noreply.github.com>
1 parent 3992a44 commit 2fbbc1c

File tree

11 files changed

+39
-103
lines changed

11 files changed

+39
-103
lines changed

docs/.vuepress/client.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
// .vuepress/client.ts
2-
import { defineClientConfig } from "@vuepress/client";
1+
import { defineClientConfig } from "vuepress/client";
32
import NaiveClient from "./components/NaiveClient.vue";
43

54
export default defineClientConfig({

docs/.vuepress/components/HomeAds.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script setup lang="ts">
2-
import { usePageData } from "@vuepress/client"
2+
import { usePageData } from "vuepress/client"
33
import { computed } from "vue"
44
55
const pageData = usePageData()

docs/.vuepress/components/HomePage.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@
1010
<script setup lang="ts">
1111
import HopeHomePage from "vuepress-theme-hope/components/HomePage";
1212
// import HomeAds from "./HomeAds.vue";
13-
import { ClientOnly } from "@vuepress/client";
13+
import { ClientOnly } from "vuepress/client";
1414
1515
</script>

docs/.vuepress/components/NaiveClient.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<script lang="ts" setup>
2-
32
import NaiveConfig from './NaiveConfig.vue';
4-
import { ClientOnly } from '@vuepress/client';
3+
import { ClientOnly } from 'vuepress/client';
54
import { Suspense } from 'vue'
65
import { NSpace, NSpin } from 'naive-ui'
76

docs/.vuepress/components/NormalPage.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
</template>
1111
<script setup lang="ts">
1212
import NormalPage from "vuepress-theme-hope/components/NormalPage";
13-
import { usePageFrontmatter } from "@vuepress/client";
13+
import { usePageFrontmatter } from "vuepress/client";
1414
import { computed } from "vue";
15-
import { usePageData } from '@vuepress/client'
15+
import { usePageData } from 'vuepress/client'
1616
import NaiveClient from './NaiveClient.vue'
1717
import ApiSelect from "./api/ApiSelect.vue";
1818

docs/.vuepress/components/Sidebar.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
</template>
2020
<script setup lang="ts">
2121
import Sidebar from "vuepress-theme-hope/modules/sidebar/components/Sidebar";
22-
import { usePageData } from "@vuepress/client";
22+
import { usePageData } from "vuepress/client";
2323
import { computed } from "vue";
2424
import ApiSelect from "./api/ApiSelect.vue";
2525

docs/.vuepress/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { defineUserConfig } from "vuepress";
22
import { viteBundler } from '@vuepress/bundler-vite'
3-
import { getDirname, path } from "@vuepress/utils";
3+
import { getDirname, path } from "vuepress/utils";
44
import theme from "./theme.js";
55

66
const __dirname = getDirname(import.meta.url);

docs/.vuepress/styles/index.scss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
h1 .vp-icon {
2+
font-size: 1em;
3+
}

docs/.vuepress/theme.ts

Lines changed: 14 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,6 @@ export default hopeTheme(
88
logo: "/logo.svg",
99
repo: "OpenListTeam/docs",
1010
// hostname: "https://docs.oplist.org",
11-
// 移动到 palette.scss 文件中
12-
// themeColor: {
13-
// blue: "#2196f3",
14-
// red: "#f26d6d",
15-
// green: "#3eaf7c",
16-
// orange: "#fb9b5f",
17-
// },
1811

1912
author: {
2013
name: "The OpenList Projects Contributors",
@@ -25,57 +18,37 @@ export default hopeTheme(
2518

2619
locales: {
2720
"/": {
28-
// navbar
2921
navbar: navbar.en,
30-
31-
// sidebar
3222
sidebar: sidebar.en,
33-
34-
footer: ``,
35-
23+
footer: '',
3624
displayFooter: true,
3725
},
3826

3927
/**
4028
* Chinese locale config
4129
*/
4230
"/zh/": {
43-
// navbar
4431
navbar: navbar.zh,
45-
46-
// sidebar
4732
sidebar: sidebar.zh,
48-
49-
footer: ``,
50-
33+
footer: '',
5134
displayFooter: true,
5235
},
5336
},
5437
markdown: {
55-
imgMark: true, //支持图片标记
56-
imgLazyload: true, //支持图片懒加载
57-
// figure: true, //支持图片描述
58-
imgSize: true, //支持图片大小
59-
tabs: true, //支持表格
60-
gfm: true, //支持完整的 GFM 语法
61-
tasklist: true, //支持任务列表
62-
include: true, //支持 include 语法
63-
align: true, //支持对齐
64-
mark: true, //支持标记
65-
sub: true, //支持下标
66-
sup: true, //支持上标
67-
flowchart: true, //支持流程图
68-
demo: true, //支持 demo
69-
mermaid: true, //支持 Mermaid
70-
chartjs: true, //支持 Chart.js
71-
echarts: true, //支持 ECharts
72-
plantuml: true, //支持 PlantUML
73-
codeTabs: true, //支持代码块分组
74-
// container: true,
38+
imgMark: true,
39+
imgLazyload: true,
40+
tabs: true,
41+
gfm: true,
42+
tasklist: true,
43+
include: true,
44+
mark: true,
45+
sub: true,
46+
sup: true,
47+
flowchart: true,
48+
mermaid: true,
49+
codeTabs: true,
7550
},
7651
plugins: {
77-
// 水印选项
78-
// 参考配置:https://zhensherlock.github.io/watermark-js-plus/zh/config
7952
watermark:{
8053
enabled: false,
8154
},
@@ -92,11 +65,9 @@ export default hopeTheme(
9265
toc: false,
9366
}),
9467
},
95-
//
9668
components: {
9769
components: ["ArtPlayer", "BiliBili", "Badge", "VPCard"],
9870
},
99-
// 图标
10071
icon: {
10172
assets: [
10273
"//at.alicdn.com/t/c/font_2410206_5vb9zlyghj.css",
@@ -105,9 +76,6 @@ export default hopeTheme(
10576
]
10677
},
10778
comment: {
108-
/**
109-
* Using Giscus 评论
110-
*/
11179
provider: "Giscus",
11280
repo: "OpenListTeam/docs",
11381
repoId: "R_kgDOO52WYA",
@@ -166,9 +134,6 @@ export default hopeTheme(
166134
},
167135
},
168136
{
169-
check: true,
170-
compact: true,
171137
custom: true,
172-
debug: false,
173138
}
174139
);

package.json

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,13 @@
1818
},
1919
"devDependencies": {
2020
"@types/node": "^18.19.75",
21-
"@vuepress/client": "2.0.0-rc.19",
21+
"@vuepress/bundler-vite": "2.0.0-rc.19",
2222
"@vuepress/plugin-docsearch": "2.0.0-rc.74",
23-
"@vuepress/utils": "2.0.0-rc.19",
2423
"artplayer": "^5.2.2",
25-
"chart.js": "^4.4.7",
2624
"dashjs": "^4.7.4",
27-
"echarts": "^5.6.0",
2825
"flowchart.ts": "^3.0.1",
2926
"hls.js": "^1.5.20",
27+
"markdown-it": "^14.1.0",
3028
"mathjax-full": "^3.2.2",
3129
"mermaid": "^11.4.1",
3230
"mpegts.js": "^1.8.0",
@@ -35,9 +33,5 @@
3533
"vue": "^3.5.13",
3634
"vuepress": "2.0.0-rc.19",
3735
"vuepress-theme-hope": "2.0.0-rc.71"
38-
},
39-
"dependencies": {
40-
"@vuepress/bundler-vite": "2.0.0-rc.19",
41-
"markdown-it": "^14.1.0"
4236
}
4337
}

0 commit comments

Comments
 (0)