File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11// https://vitepress.dev/guide/custom-theme
2- import { h } from 'vue'
32import Theme from 'vitepress/theme'
3+ import MyLayout from './layout/MyLayout.vue'
44import './style.css'
55
66export default {
77 extends : Theme ,
8- Layout : ( ) => {
9- return h ( Theme . Layout , null , {
10- // https://vitepress.dev/guide/extending-default-theme#layout-slots
11- } )
12- } ,
8+ Layout : MyLayout ,
139 enhanceApp ( { app, router, siteData } ) {
1410 // ...
1511 }
Original file line number Diff line number Diff line change 1+ <script setup lang="ts">
2+ import { useData } from ' vitepress'
3+ import { watchEffect } from ' vue'
4+
5+ const { title, isDark } = useData ()
6+ let darkTheme = isDark .value ? ' dark' : ' light'
7+
8+ watchEffect (() => {
9+ darkTheme = isDark .value ? ' dark' : ' light'
10+ })
11+
12+ </script >
13+
14+ <template >
15+ <div class =" layout-comments" >
16+ <component
17+ :is =" 'script'"
18+ :key =" title"
19+ src =" https://giscus.app/client.js"
20+ data-repo =" guangzhengli/k8s-tutorials"
21+ data-repo-id =" R_kgDOHS_wpg"
22+ data-category =" General"
23+ data-category-id =" DIC_kwDOHS_wps4CRGNY"
24+ data-mapping =" pathname"
25+ data-strict =" 0"
26+ data-reactions-enabled =" 1"
27+ data-emit-metadata =" 0"
28+ data-input-position =" bottom"
29+ :data-theme =" darkTheme"
30+ data-lang =" en"
31+ data-loading =" lazy"
32+ crossorigin =" anonymous"
33+ async
34+ />
35+ </div >
36+ </template >
Original file line number Diff line number Diff line change 1+ <script setup lang="ts">
2+ import DefaultTheme from ' vitepress/theme'
3+ import Comments from ' ./Comments.vue'
4+
5+ const { Layout } = DefaultTheme
6+ </script >
7+
8+ <template >
9+ <Layout >
10+ <template #doc-after >
11+ <Comments />
12+ </template >
13+ </Layout >
14+ </template >
Original file line number Diff line number Diff line change 8989 --docsearch-primary-color : var (--vp-c-brand ) !important ;
9090}
9191
92+ .layout-comments {
93+ margin-top : 2rem ;
94+ }
95+
You can’t perform that action at this time.
0 commit comments