mirror of
https://github.com/ryan4yin/nixos-and-flakes-book.git
synced 2025-03-13 23:58:51 +01:00
fix: giscus for default lang(English)
This commit is contained in:
parent
c49e0d4892
commit
36eb36cac6
@ -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
3737
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user