feat: add `@` alias for include
This commit is contained in:
parent
76b220540b
commit
d993af3421
|
@ -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: {
|
||||
|
|
|
@ -12,4 +12,4 @@ icon: "configuration"
|
|||
|
||||
![](https://oss.javaguide.cn/xingqiu/image-20220304102536445.png)
|
||||
|
||||
<!-- @include: ../planet.snippet.md -->
|
||||
<!-- @include: @planet.snippet.md -->
|
||||
|
|
|
@ -12,4 +12,4 @@ icon: "transanction"
|
|||
|
||||
![](https://oss.javaguide.cn/xingqiu/image-20220304102536445.png)
|
||||
|
||||
<!-- @include: ../planet.snippet.md -->
|
||||
<!-- @include: @planet.snippet.md -->
|
||||
|
|
|
@ -9,4 +9,4 @@ category: 高可用
|
|||
|
||||
![](https://oss.javaguide.cn/xingqiu/image-20220304102536445.png)
|
||||
|
||||
<!-- @include: ../planet.snippet.md -->
|
||||
<!-- @include: @planet.snippet.md -->
|
||||
|
|
|
@ -19,4 +19,4 @@ head:
|
|||
|
||||
![](https://oss.javaguide.cn/xingqiu/image-20220304102536445.png)
|
||||
|
||||
<!-- @include: ../planet.snippet.md -->
|
||||
<!-- @include: @planet.snippet.md -->
|
||||
|
|
|
@ -20,7 +20,7 @@ title: JavaGuide(Java学习&&面试指南)
|
|||
|
||||
[GitHub](https://github.com/Snailclimb/JavaGuide) | [Gitee](https://gitee.com/SnailClimb/JavaGuide)
|
||||
|
||||
<!-- @include: ./banner.snippet.md -->
|
||||
<!-- @include: @banner.snippet.md -->
|
||||
|
||||
## 项目相关
|
||||
|
||||
|
|
|
@ -19,4 +19,4 @@ category: 知识星球
|
|||
|
||||
![](https://oss.javaguide.cn/xingqiu/image-20220628101805897.png)
|
||||
|
||||
<!-- @include: ./planet.snippet.md -->
|
||||
<!-- @include: @planet.snippet.md -->
|
||||
|
|
|
@ -15,4 +15,4 @@ category: 知识星球
|
|||
|
||||
![](https://oss.javaguide.cn/xingqiu/image-20220628102848236.png)
|
||||
|
||||
<!-- @include: ./planet.snippet.md -->
|
||||
<!-- @include: @planet.snippet.md -->
|
||||
|
|
|
@ -9,7 +9,7 @@ category: 走近项目
|
|||
|
||||
《JavaGuide 面试突击版》在我的公众号后台回复“**PDF**”即可获取,免费的。除了 《JavaGuide 面试突击版》之外,还会免费送你多本优质面试 PDF 手册。
|
||||
|
||||
<!-- @include: ./gzh.md -->
|
||||
<!-- @include: @gzh.md -->
|
||||
|
||||
## 如何看待 JavaGuide 的 star 数量很多?
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ footer: |-
|
|||
<a href="https://beian.miit.gov.cn/" target="_blank">鄂ICP备2020015769号-1</a> | 主题: <a href="https://vuepress-theme-hope.github.io/v2/" target="_blank">VuePress Theme Hope</a>
|
||||
---
|
||||
|
||||
<!-- @include: ./banner.snippet.md -->
|
||||
<!-- @include: @banner.snippet.md -->
|
||||
|
||||
## 关于网站
|
||||
|
||||
|
@ -44,4 +44,4 @@ footer: |-
|
|||
|
||||
最新更新会第一时间同步在公众号,推荐关注!另外,公众号上有很多干货不会同步在线阅读网站。
|
||||
|
||||
<!-- @include: ./gzh.snippet.md -->
|
||||
<!-- @include: @gzh.snippet.md -->
|
||||
|
|
|
@ -12,4 +12,4 @@ icon: "design"
|
|||
|
||||
![](https://oss.javaguide.cn/xingqiu/image-20220304102536445.png)
|
||||
|
||||
<!-- @include: ../planet.snippet.md -->
|
||||
<!-- @include: @planet.snippet.md -->
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue