diff --git a/docs/.vuepress/theme.ts b/docs/.vuepress/theme.ts
index 821935b3..a723eac5 100644
--- a/docs/.vuepress/theme.ts
+++ b/docs/.vuepress/theme.ts
@@ -1,8 +1,11 @@
+import { getDirname, path } from "@vuepress/utils";
import { hopeTheme } from "vuepress-theme-hope";
import navbar from "./navbar.js";
import sidebar from "./sidebar/index.js";
+const __dirname = getDirname(import.meta.url);
+
export default hopeTheme({
logo: "/logo.png",
hostname: "https://javaguide.cn/",
@@ -51,7 +54,18 @@ export default hopeTheme({
codetabs: true,
container: true,
figure: true,
- include: true,
+ include: {
+ resolvePath: (file, cwd) => {
+ if (file.startsWith("@"))
+ return path.resolve(
+ __dirname,
+ "../snippets",
+ file.replace("@", "./")
+ );
+
+ return path.resolve(cwd, file);
+ },
+ },
tasklist: true,
},
feed: {
diff --git a/docs/distributed-system/distributed-configuration-center.md b/docs/distributed-system/distributed-configuration-center.md
index 718728da..12e2578f 100644
--- a/docs/distributed-system/distributed-configuration-center.md
+++ b/docs/distributed-system/distributed-configuration-center.md
@@ -12,4 +12,4 @@ icon: "configuration"

-
+
diff --git a/docs/distributed-system/distributed-transaction.md b/docs/distributed-system/distributed-transaction.md
index 5df1584c..1a22e275 100644
--- a/docs/distributed-system/distributed-transaction.md
+++ b/docs/distributed-system/distributed-transaction.md
@@ -12,4 +12,4 @@ icon: "transanction"

-
+
diff --git a/docs/high-availability/fallback&circuit-breaker.md b/docs/high-availability/fallback&circuit-breaker.md
index 0e7d5cf5..bea336d1 100644
--- a/docs/high-availability/fallback&circuit-breaker.md
+++ b/docs/high-availability/fallback&circuit-breaker.md
@@ -9,4 +9,4 @@ category: 高可用

-
+
diff --git a/docs/high-performance/sql-optimization.md b/docs/high-performance/sql-optimization.md
index 7a0d332d..ad39c4d2 100644
--- a/docs/high-performance/sql-optimization.md
+++ b/docs/high-performance/sql-optimization.md
@@ -19,4 +19,4 @@ head:

-
+
diff --git a/docs/home.md b/docs/home.md
index bc9d38d7..1d10c683 100644
--- a/docs/home.md
+++ b/docs/home.md
@@ -20,7 +20,7 @@ title: JavaGuide(Java学习&&面试指南)
[GitHub](https://github.com/Snailclimb/JavaGuide) | [Gitee](https://gitee.com/SnailClimb/JavaGuide)
-
+
## 项目相关
diff --git a/docs/interview-preparation/interview-experience.md b/docs/interview-preparation/interview-experience.md
index c70ec7c1..1954a69b 100644
--- a/docs/interview-preparation/interview-experience.md
+++ b/docs/interview-preparation/interview-experience.md
@@ -19,4 +19,4 @@ category: 知识星球

-
+
diff --git a/docs/interview-preparation/self-test-of-common-interview-questions.md b/docs/interview-preparation/self-test-of-common-interview-questions.md
index 45b4e54a..d658ccf4 100644
--- a/docs/interview-preparation/self-test-of-common-interview-questions.md
+++ b/docs/interview-preparation/self-test-of-common-interview-questions.md
@@ -15,4 +15,4 @@ category: 知识星球

-
+
diff --git a/docs/javaguide/faq.md b/docs/javaguide/faq.md
index 192a12fc..41cdaf12 100644
--- a/docs/javaguide/faq.md
+++ b/docs/javaguide/faq.md
@@ -9,7 +9,7 @@ category: 走近项目
《JavaGuide 面试突击版》在我的公众号后台回复“**PDF**”即可获取,免费的。除了 《JavaGuide 面试突击版》之外,还会免费送你多本优质面试 PDF 手册。
-
+
## 如何看待 JavaGuide 的 star 数量很多?
diff --git a/docs/readme.md b/docs/readme.md
index d00ade00..6e986d5c 100644
--- a/docs/readme.md
+++ b/docs/readme.md
@@ -16,7 +16,7 @@ footer: |-
鄂ICP备2020015769号-1 | 主题: VuePress Theme Hope
---
-
+
## 关于网站
@@ -44,4 +44,4 @@ footer: |-
最新更新会第一时间同步在公众号,推荐关注!另外,公众号上有很多干货不会同步在线阅读网站。
-
+
diff --git a/docs/banner.snippet.md b/docs/snippets/banner.snippet.md
similarity index 100%
rename from docs/banner.snippet.md
rename to docs/snippets/banner.snippet.md
diff --git a/docs/gzh.snippet.md b/docs/snippets/gzh.snippet.md
similarity index 100%
rename from docs/gzh.snippet.md
rename to docs/snippets/gzh.snippet.md
diff --git a/docs/planet.snippet.md b/docs/snippets/planet.snippet.md
similarity index 100%
rename from docs/planet.snippet.md
rename to docs/snippets/planet.snippet.md
diff --git a/docs/system-design/system-design-questions.md b/docs/system-design/system-design-questions.md
index e5a9bbbc..6c321da7 100644
--- a/docs/system-design/system-design-questions.md
+++ b/docs/system-design/system-design-questions.md
@@ -12,4 +12,4 @@ icon: "design"

-
+
diff --git a/package.json b/package.json
index 98f8c1a3..bf38de4f 100644
--- a/package.json
+++ b/package.json
@@ -22,6 +22,7 @@
},
"dependencies": {
"@vuepress/client": "2.0.0-beta.61",
+ "@vuepress/utils": "2.0.0-beta.61",
"husky": "8.0.3",
"markdownlint-cli": "0.33.0",
"nano-staged": "0.8.0",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 6358a33e..ea7af189 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -4,6 +4,9 @@ dependencies:
'@vuepress/client':
specifier: 2.0.0-beta.61
version: 2.0.0-beta.61
+ '@vuepress/utils':
+ specifier: 2.0.0-beta.61
+ version: 2.0.0-beta.61
husky:
specifier: 8.0.3
version: 8.0.3