Skip to content

Commit 840cb19

Browse files
committed
Merge branch 'v4' of https://github.com/jackyzha0/quartz into v4
2 parents 870657c + cdd0be2 commit 840cb19

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

docs/features/comments.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ afterBody: [
4545
category: 'Announcements',
4646
// from data-category-id
4747
categoryId: 'DIC_kwDOFxRnmM4B-Xg6',
48+
// from data-lang
49+
lang: 'en'
4850
}
4951
}),
5052
],
@@ -90,6 +92,10 @@ type Options = {
9092
// where to put the comment input box relative to the comments
9193
// defaults to 'bottom'
9294
inputPosition?: "top" | "bottom"
95+
96+
// set your preference language here
97+
// defaults to 'en'
98+
lang?: string
9399
}
94100
}
95101
```

quartz/components/scripts/comments.inline.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ type GiscusElement = Omit<HTMLElement, "dataset"> & {
5555
strict: string
5656
reactionsEnabled: string
5757
inputPosition: "top" | "bottom"
58+
lang: string
5859
}
5960
}
6061

@@ -78,7 +79,7 @@ document.addEventListener("nav", () => {
7879
giscusScript.setAttribute("data-strict", giscusContainer.dataset.strict)
7980
giscusScript.setAttribute("data-reactions-enabled", giscusContainer.dataset.reactionsEnabled)
8081
giscusScript.setAttribute("data-input-position", giscusContainer.dataset.inputPosition)
81-
82+
giscusScript.setAttribute("data-lang", giscusContainer.dataset.lang)
8283
const theme = document.documentElement.getAttribute("saved-theme")
8384
if (theme) {
8485
giscusScript.setAttribute("data-theme", getThemeUrl(getThemeName(theme)))

0 commit comments

Comments
 (0)