Skip to content

Commit

Permalink
feat: Add Comment Component
Browse files Browse the repository at this point in the history
  • Loading branch information
Pylogmon committed Nov 19, 2023
1 parent 9a6114d commit f6119c1
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 25 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"vue": "^3.3.7"
},
"dependencies": {
"axios": "^1.6.0"
"axios": "^1.6.0",
"vitepress-plugin-comment-with-giscus": "^1.1.9"
}
}
86 changes: 62 additions & 24 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions vitepress/.vitepress/theme/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
import { h } from "vue";
import Theme from "vitepress/theme";
import AppPreview from "./components/AppPreview.vue";
import giscusTalk from 'vitepress-plugin-comment-with-giscus';
import { useData, useRoute } from 'vitepress';
import "./style.css";

/** @type {import('vitepress').Theme} */
Expand All @@ -16,4 +18,21 @@ export default {
enhanceApp({ app, router, siteData }) {
// ...
},
setup() {
const { frontmatter } = useData();
const route = useRoute();
giscusTalk({
repo: 'pot-app/pot-desktop',
repoId: 'R_kgDOJCp3Ww',
category: 'General',
categoryId: 'DIC_kwDOJCp3W84CUrQN',
mapping: 'title',
inputPosition: 'top',
lang: 'zh-CN',
}, {
frontmatter, route
},
true
);
}
};

0 comments on commit f6119c1

Please sign in to comment.