File tree 4 files changed +2824
-653
lines changed
4 files changed +2824
-653
lines changed Original file line number Diff line number Diff line change
1
+ <template >
2
+ <div style =" margin-top : 24px " >
3
+ <Giscus
4
+ :key =" route.path"
5
+ :theme =" isDark ? 'dark' : 'light'"
6
+ id =" comments"
7
+ repo =" luckfunc/blog"
8
+ repoid =" R_kgDOIN2Meg"
9
+ category =" General"
10
+ category-id =" DIC_kwDOIrDrIs4ClpeT"
11
+ mapping =" pathname"
12
+ term =" Welcome to giscus!"
13
+ reactionsenabled =" 1"
14
+ emitmetadata =" 0"
15
+ inputposition =" top"
16
+ loading =" lazy"
17
+ />
18
+ </div >
19
+ </template >
20
+
21
+ <script setup>
22
+ import Giscus from ' @giscus/vue' ;
23
+ import { useRoute , useData } from ' vitepress' ;
24
+
25
+ const route = useRoute ();
26
+ const { isDark } = useData ();
27
+ </script >
Original file line number Diff line number Diff line change 1
- import Theme from "vitepress/theme" ;
1
+ import { h } from 'vue' ;
2
+ import Theme from 'vitepress/theme' ;
3
+ import GiscusComment from './components/GiscusComment.vue' ;
2
4
import './style/custom.css' ;
3
5
import './style/var.css'
6
+
4
7
export default {
5
- ...Theme
8
+ ...Theme ,
9
+ Layout ( ) {
10
+ return h ( Theme . Layout , null , {
11
+ 'doc-after' : ( ) => h ( GiscusComment )
12
+ } )
13
+ }
6
14
}
You can’t perform that action at this time.
0 commit comments