-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ef02c14
commit 7b6a4bb
Showing
3 changed files
with
112 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,52 @@ | ||
// https://vitepress.dev/guide/custom-theme | ||
import { h } from 'vue' | ||
import DefaultTheme from 'vitepress/theme' | ||
import './style.css' | ||
import { h } from "vue"; | ||
import DefaultTheme from "vitepress/theme"; | ||
import giscusTalk from "vitepress-plugin-comment-with-giscus"; | ||
import { useData, useRoute } from "vitepress"; | ||
import "./style.css"; | ||
|
||
/** @type {import('vitepress').Theme} */ | ||
export default { | ||
extends: DefaultTheme, | ||
Layout: () => { | ||
return h(DefaultTheme.Layout, null, { | ||
// https://vitepress.dev/guide/extending-default-theme#layout-slots | ||
}) | ||
}, | ||
enhanceApp({ app, router, siteData }) { | ||
// ... | ||
} | ||
} | ||
extends: DefaultTheme, | ||
Layout: () => { | ||
return h(DefaultTheme.Layout, null, { | ||
// https://vitepress.dev/guide/extending-default-theme#layout-slots | ||
}); | ||
}, | ||
enhanceApp({ app, router, siteData }) { | ||
// ... | ||
}, | ||
setup() { | ||
// 获取前言和路由 | ||
const { frontmatter } = useData(); | ||
const route = useRoute(); | ||
|
||
// 评论组件 - https://giscus.app/ | ||
giscusTalk( | ||
{ | ||
repo: "Muxi-Studio/101", //仓库 | ||
repoId: "MDEwOlJlcG9zaXRvcnkxOTk3NjMzNDI=", //仓库ID | ||
category: "DIC_kwDOC-gljs4CeRk6", // 讨论分类 | ||
categoryId: "your category id", //讨论分类ID | ||
mapping: "pathname", // 默认: `pathname` | ||
strict: "1", | ||
term: "Welcome to @giscus/vue component!", | ||
reactionsEnabled: "1", | ||
emitMetadata: "1", | ||
inputPosition: "top", // 默认: `top` | ||
lang: "zh-CN", // 默认: `zh-CN` | ||
lightTheme: "light", // 默认: `light` | ||
darkTheme: "dark", // 默认: `transparent_dark` | ||
loading: "lazy", | ||
}, | ||
{ | ||
frontmatter, | ||
route, | ||
}, | ||
//默认值为true,表示已启用,此参数可以忽略; | ||
//如果为false,则表示未启用 | ||
//您可以使用“comment:true”序言在页面上单独启用它 | ||
true | ||
); | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.