README
EN | 中文文档
vitepress
comment section plugin based on giscus
Install
// npm
npm i vitepress-plugin-comment-with-giscus
// yarn
yarn add vitepress-plugin-comment-with-giscus
Usage
import DefaultTheme from 'vitepress/theme';
import giscusTalk from 'vitepress-plugin-comment-with-giscus';
import { useData } from 'vitepress';
export default {
...DefaultTheme,
enhanceApp(ctx) {
DefaultTheme.enhanceApp(ctx);
},
setup() {
const { frontmatter } = useData();
giscusTalk(frontmatter, {
repo: 'your github repository',
repoId: 'your repository id',
categoryId: 'your category id',
mapping: 'pathname'
});
}
};
For the parameter acquisition method of giscus
, please refer to:giscus configuration
Extended
If the following code is added to the preface of the article, the comment area will not be generated
---
comment: false
---