fix: giscus for default lang(English)

This commit is contained in:
Ryan Yin 2024-11-22 17:32:15 +08:00
parent c49e0d4892
commit 36eb36cac6
2 changed files with 2063 additions and 1695 deletions

View File

@ -1,13 +1,13 @@
// .vitepress/theme/index.ts
// https://github.com/T-miracle/vitepress-plugin-comment-with-giscus
import DefaultTheme from "vitepress/theme"
import giscusTalk from "vitepress-plugin-comment-with-giscus"
import { useData, useRoute } from "vitepress"
import { toRefs } from "vue"
// custom CSS
import "../style/print.css"
export default {
// Extending the Default Theme
...DefaultTheme,
enhanceApp(ctx) {
DefaultTheme.enhanceApp(ctx)
@ -15,7 +15,7 @@ export default {
},
setup() {
// Get frontmatter and route
const { frontmatter } = useData()
const { frontmatter } = toRefs(useData())
const route = useRoute()
// Obtain configuration from: https://giscus.app/
@ -25,10 +25,21 @@ export default {
repoId: "R_kgDOJzAhDA",
category: "Announcements", // default: `General`
categoryId: "DIC_kwDOJzAhDM4CXtJ8",
mapping: "pathname", // default: `pathname`
inputPosition: "top", // default: `top`
lang: "en", // default: `zh-CN`
loading: "lazy",
lang: "en-US", // default: `zh-CN`
// i18n setting (Note: This configuration will override the default language set by lang)
// Configured as an object with key-value pairs inside:
// [your i18n configuration name]: [corresponds to the language pack name in Giscus]
locales: {
"zh-CN": "zh-CN",
"en-US": "en",
// "ja-JP": "ja",
},
// Avoid mismatches due to GitHub's fuzzy searching method when there are multiple discussions with similar titles/pathname.
strict: "1",
homePageShowComment: false, // Whether to display the comment area on the homepage, the default is false
lightTheme: "light", // default: `light`
darkTheme: "transparent_dark", // default: `transparent_dark`
// ...

3737
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff