Skip to content

Commit

Permalink
fix: giscus for default lang(English)
Browse files Browse the repository at this point in the history
  • Loading branch information
ryan4yin committed Nov 22, 2024
1 parent c49e0d4 commit 36eb36c
Show file tree
Hide file tree
Showing 2 changed files with 1,964 additions and 1,596 deletions.
21 changes: 16 additions & 5 deletions docs/.vitepress/theme/index.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
// .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)
// ...
},
setup() {
// Get frontmatter and route
const { frontmatter } = useData()
const { frontmatter } = toRefs(useData())
const route = useRoute()

// Obtain configuration from: https://giscus.app/
Expand All @@ -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`
// ...
Expand Down
Loading

0 comments on commit 36eb36c

Please sign in to comment.