Skip to content

Commit

Permalink
修复giscusTalk
Browse files Browse the repository at this point in the history
  • Loading branch information
wisdommen committed Jan 23, 2024
1 parent e25189c commit a8bb219
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions .vitepress/theme/index.mts
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,20 @@ import ReloadPrompt from './components/ReloadPrompt.vue'
export default {
...DefaultTheme,
Layout() {
const {lang} = useData()
if (inBrowser) {
document.cookie = `nf_lang=${lang.value}; expires=Mon, 1 Jan 2030 00:00:00 UTC; path=/`
}

watchEffect(() => {
const {lang} = useData()
if (inBrowser) {
document.cookie = `nf_lang=${lang.value}; expires=Mon, 1 Jan 2030 00:00:00 UTC; path=/`
}
const {frontmatter} = useData();
const route = useRoute();

let language = lang.value.split('-')[0];
if (language === 'zh') {
language = 'zh-CN'
}
const {frontmatter} = useData();
const route = useRoute();

// Obtain configuration from: https://giscus.app/
giscusTalk({
repo: 'UltiKits/UltiTools-Dev-Doc',
Expand All @@ -62,6 +65,7 @@ export default {
},
true
);
})
return h(DefaultTheme.Layout, null, {
'nav-bar-content-after': () => h(NolebaseEnhancedReadabilitiesMenu),
'nav-screen-content-after': () => h(NolebaseEnhancedReadabilitiesScreenMenu),
Expand Down

0 comments on commit a8bb219

Please sign in to comment.