-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
5 changed files
with
104 additions
and
86 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
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
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,50 +1,53 @@ | ||
// .vitepress/theme/index.js | ||
import DefaultTheme from 'vitepress/theme'; | ||
import DefaultTheme from "vitepress/theme"; | ||
|
||
import giscusTalk from 'vitepress-plugin-comment-with-giscus'; | ||
import giscusTalk from "vitepress-plugin-comment-with-giscus"; | ||
|
||
import codeblocksFold from 'vitepress-plugin-codeblocks-fold'; | ||
import 'vitepress-plugin-codeblocks-fold/style/index.scss'; | ||
import codeblocksFold from "vitepress-plugin-codeblocks-fold"; | ||
import "vitepress-plugin-codeblocks-fold/style/index.scss"; | ||
|
||
import 'viewerjs/dist/viewer.min.css'; | ||
import imageViewer from './ImgViewer'; | ||
import "viewerjs/dist/viewer.min.css"; | ||
import imageViewer from "./ImgViewer"; | ||
|
||
import { useData, useRoute } from 'vitepress'; | ||
import { useData, useRoute } from "vitepress"; | ||
|
||
export default { | ||
...DefaultTheme, | ||
enhanceApp(ctx) { | ||
DefaultTheme.enhanceApp(ctx); | ||
}, | ||
setup() { | ||
// Get frontmatter and route | ||
const { frontmatter } = useData(); | ||
const route = useRoute(); | ||
|
||
// code fold support | ||
codeblocksFold({ route, frontmatter }, true, 400); | ||
|
||
// imageView | ||
imageViewer(route); | ||
|
||
// Obtain configuration from: https://giscus.app/ | ||
giscusTalk({ | ||
repo: 'learnzig/learnzig', | ||
repoId: 'R_kgDOKRsb5Q', | ||
category: 'Comments', // default: `General` | ||
categoryId: 'DIC_kwDOKRsb5c4Cbx2i', | ||
mapping: 'pathname', // default: `pathname` | ||
inputPosition: 'top', // default: `top` | ||
lang: 'zh-CN', // default: `zh-CN` | ||
strict: "1", | ||
reactionsEnabled: "1", | ||
// theme:"dark", | ||
lightTheme: "light", | ||
darkTheme:"dark" | ||
}, { | ||
frontmatter, route | ||
}, | ||
true | ||
); | ||
} | ||
}; | ||
...DefaultTheme, | ||
enhanceApp(ctx) { | ||
DefaultTheme.enhanceApp(ctx); | ||
}, | ||
setup() { | ||
// Get frontmatter and route | ||
const { frontmatter } = useData(); | ||
const route = useRoute(); | ||
|
||
// code fold support | ||
codeblocksFold({ route, frontmatter }, true, 400); | ||
|
||
// imageView | ||
imageViewer(route); | ||
|
||
// Obtain configuration from: https://giscus.app/ | ||
giscusTalk( | ||
{ | ||
repo: "learnzig/learnzig", | ||
repoId: "R_kgDOKRsb5Q", | ||
category: "Comments", // default: `General` | ||
categoryId: "DIC_kwDOKRsb5c4Cbx2i", | ||
mapping: "pathname", // default: `pathname` | ||
inputPosition: "top", // default: `top` | ||
lang: "zh-CN", // default: `zh-CN` | ||
strict: "1", | ||
reactionsEnabled: "1", | ||
// theme:"dark", | ||
lightTheme: "light", | ||
darkTheme: "dark", | ||
}, | ||
{ | ||
frontmatter, | ||
route, | ||
}, | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
outline: deep | ||
--- | ||
|
||
# 内建函数 | ||
|
||
TODO |
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