Skip to content

Commit 3a2bd94

Browse files
authored
Update giscus config (#300)
1 parent bd0cfeb commit 3a2bd94

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

giscus-comments.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,9 +263,15 @@
263263
script.setAttribute('data-input-position', 'bottom');
264264
script.setAttribute('data-theme', currentTheme === 'dark' ? 'dark' : 'light');
265265

266-
// Set language based on path
266+
// Set language based on path - only Chinese pages should be marked as Chinese
267267
const isChinesePage = newPath.includes('/zh-CN/') || newPath.includes('/cn/');
268-
script.setAttribute('data-lang', isChinesePage ? 'zh-CN' : 'en');
268+
const giscusLang = isChinesePage ? 'zh-CN' : 'en';
269+
script.setAttribute('data-lang', giscusLang);
270+
271+
// Debug logging
272+
console.log('Giscus: Current path:', newPath);
273+
console.log('Giscus: Is Chinese page:', isChinesePage);
274+
console.log('Giscus: Language set to:', giscusLang);
269275
script.setAttribute('crossorigin', 'anonymous');
270276
script.async = true;
271277

0 commit comments

Comments
 (0)