mirror of
https://github.com/ryan4yin/nixos-and-flakes-book.git
synced 2025-06-21 12:31:42 +02: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 DefaultTheme from "vitepress/theme"
|
||||||
import giscusTalk from "vitepress-plugin-comment-with-giscus"
|
import giscusTalk from "vitepress-plugin-comment-with-giscus"
|
||||||
import { useData, useRoute } from "vitepress"
|
import { useData, useRoute } from "vitepress"
|
||||||
|
import { toRefs } from "vue"
|
||||||
|
|
||||||
// custom CSS
|
// custom CSS
|
||||||
import "../style/print.css"
|
import "../style/print.css"
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
// Extending the Default Theme
|
|
||||||
...DefaultTheme,
|
...DefaultTheme,
|
||||||
enhanceApp(ctx) {
|
enhanceApp(ctx) {
|
||||||
DefaultTheme.enhanceApp(ctx)
|
DefaultTheme.enhanceApp(ctx)
|
||||||
@ -15,7 +15,7 @@ export default {
|
|||||||
},
|
},
|
||||||
setup() {
|
setup() {
|
||||||
// Get frontmatter and route
|
// Get frontmatter and route
|
||||||
const { frontmatter } = useData()
|
const { frontmatter } = toRefs(useData())
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
|
|
||||||
// Obtain configuration from: https://giscus.app/
|
// Obtain configuration from: https://giscus.app/
|
||||||
@ -25,10 +25,21 @@ export default {
|
|||||||
repoId: "R_kgDOJzAhDA",
|
repoId: "R_kgDOJzAhDA",
|
||||||
category: "Announcements", // default: `General`
|
category: "Announcements", // default: `General`
|
||||||
categoryId: "DIC_kwDOJzAhDM4CXtJ8",
|
categoryId: "DIC_kwDOJzAhDM4CXtJ8",
|
||||||
|
|
||||||
mapping: "pathname", // default: `pathname`
|
mapping: "pathname", // default: `pathname`
|
||||||
inputPosition: "top", // default: `top`
|
inputPosition: "top", // default: `top`
|
||||||
lang: "en", // default: `zh-CN`
|
lang: "en-US", // default: `zh-CN`
|
||||||
loading: "lazy",
|
// 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`
|
lightTheme: "light", // default: `light`
|
||||||
darkTheme: "transparent_dark", // default: `transparent_dark`
|
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…
x
Reference in New Issue
Block a user