File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 17
17
initTheme = darkTheme ;
18
18
}
19
19
20
+ let lang = '{{ site.comments.giscus.lang | default: lang }}' ;
21
+ { % - comment - % } https://github.com/giscus/giscus/tree/main/locales {%- endcomment -%}
22
+ if ( lang . length > 2 && ! lang . startsWith ( 'zh' ) ) {
23
+ lang = lang . slice ( 0 , 2 ) ;
24
+ }
25
+
20
26
let giscusAttributes = {
21
27
src : 'https://giscus.app/client.js' ,
22
28
'data-repo' : '{{ site.comments.giscus.repo}}' ,
29
35
'data-emit-metadata' : '0' ,
30
36
'data-theme' : initTheme ,
31
37
'data-input-position' : '{{ site.comments.giscus.input_position | default: ' bottom ' }}' ,
32
- 'data-lang' : '{{ site.comments.giscus. lang | default: lang }}' ,
38
+ 'data-lang' : lang ,
33
39
'data-loading' : 'lazy' ,
34
40
crossorigin : 'anonymous' ,
35
41
async : ''
You can’t perform that action at this time.
0 commit comments