@@ -24,26 +24,6 @@ window.addEventListener('hashchange', () => {
24
24
window . $docsify = {
25
25
name : 'leetcode' ,
26
26
repo : 'doocs/leetcode' ,
27
- lastModifiedText : {
28
- '/README_EN' : 'Last updated: ' ,
29
- '/' : '最近更新时间:' ,
30
- } ,
31
- giscus : {
32
- repo : 'doocs/leetcode' ,
33
- repoId : 'MDEwOlJlcG9zaXRvcnkxNDkwMDEzNjU' ,
34
- category : 'Announcements' ,
35
- categoryId : 'DIC_kwDOCOGUlc4CZmhe' ,
36
- mapping : 'specific' ,
37
- term : getTerm ( ) ,
38
- reactionsEnabled : '0' ,
39
- strict : '1' ,
40
- emitMetadata : '0' ,
41
- inputPosition : 'top' ,
42
- crossorigin : 'anonymous' ,
43
- loading : 'lazy' ,
44
- theme : giscusTheme ( ) ,
45
- lang : getLang ( ) ,
46
- } ,
47
27
logo : '/images/doocs-leetcode.png' ,
48
28
search : {
49
29
depth : 2 ,
@@ -70,6 +50,22 @@ window.$docsify = {
70
50
'/solution/.*/summary_en.md' : '/solution/summary_en.md' ,
71
51
'/basic/.*/summary_en.md' : '/basic/summary_en.md' ,
72
52
} ,
53
+ lastModifiedText : {
54
+ '/README_EN' : 'Last updated: ' ,
55
+ '/' : '最近更新时间:' ,
56
+ } ,
57
+ giscus : {
58
+ repo : 'doocs/leetcode' ,
59
+ repoId : 'MDEwOlJlcG9zaXRvcnkxNDkwMDEzNjU' ,
60
+ category : 'Announcements' ,
61
+ categoryId : 'DIC_kwDOCOGUlc4CZmhe' ,
62
+ mapping : 'specific' ,
63
+ reactionsEnabled : '0' ,
64
+ strict : '1' ,
65
+ emitMetadata : '0' ,
66
+ inputPosition : 'top' ,
67
+ crossorigin : 'anonymous' ,
68
+ } ,
73
69
contributors : {
74
70
repo : 'doocs/leetcode' ,
75
71
ignores : [
@@ -145,9 +141,7 @@ window.$docsify = {
145
141
return html + footer ;
146
142
} ) ;
147
143
hook . doneEach ( ( ) => {
148
- const term = getTerm ( ) ;
149
- const lang = getLang ( ) ;
150
- var giscusScript = document . createElement ( 'script' ) ;
144
+ const giscusScript = document . createElement ( 'script' ) ;
151
145
const {
152
146
repo,
153
147
repoId,
@@ -159,8 +153,6 @@ window.$docsify = {
159
153
emitMetadata,
160
154
inputPosition,
161
155
crossorigin,
162
- loading,
163
- theme,
164
156
} = $docsify . giscus ;
165
157
giscusScript . type = 'text/javascript' ;
166
158
giscusScript . async = true ;
@@ -175,11 +167,10 @@ window.$docsify = {
175
167
giscusScript . setAttribute ( 'data-emit-metadata' , emitMetadata ) ;
176
168
giscusScript . setAttribute ( 'data-input-position' , inputPosition ) ;
177
169
giscusScript . setAttribute ( 'crossorigin' , crossorigin ) ;
178
- giscusScript . setAttribute ( 'data-loading' , loading ) ;
179
- giscusScript . setAttribute ( 'data-theme' , theme ) ;
170
+ giscusScript . setAttribute ( 'data-theme' , giscusTheme ( ) ) ;
180
171
181
- giscusScript . setAttribute ( 'data-term' , term ) ;
182
- giscusScript . setAttribute ( 'data-lang' , lang ) ;
172
+ giscusScript . setAttribute ( 'data-term' , getTerm ( ) ) ;
173
+ giscusScript . setAttribute ( 'data-lang' , getLang ( ) ) ;
183
174
184
175
document
185
176
. getElementById ( 'main' )
@@ -188,7 +179,7 @@ window.$docsify = {
188
179
document . getElementById ( 'docsify-darklight-theme' ) . addEventListener ( 'click' , ( ) => {
189
180
const frame = document . querySelector ( '.giscus-frame' ) ;
190
181
frame . contentWindow . postMessage (
191
- { giscus : { setConfig : { theme } } } ,
182
+ { giscus : { setConfig : { theme : giscusTheme ( ) } } } ,
192
183
'https://giscus.app' ,
193
184
) ;
194
185
} ) ;
0 commit comments