File tree Expand file tree Collapse file tree 2 files changed +9
-7
lines changed
samples/seed/template/public Expand file tree Collapse file tree 2 files changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,9 @@ export default {
13
13
title : 'Twitter'
14
14
}
15
15
] ,
16
+ lunrLanguages : [ 'en' , 'ru' ] ,
16
17
configureHljs : function ( hljs ) {
17
18
hljs . registerLanguage ( 'bicep' , bicep ) ;
18
19
} ,
19
20
}
21
+
Original file line number Diff line number Diff line change @@ -26,13 +26,6 @@ async function loadIndexCore() {
26
26
const data = await res . json ( ) as { [ key : string ] : SearchHit }
27
27
const cache = createStore ( 'docfx' , 'lunr' )
28
28
29
- if ( etag ) {
30
- const value = JSON . parse ( await get ( 'index' , cache ) || '{}' )
31
- if ( value && value . etag === etag ) {
32
- return { index : lunr . Index . load ( value ) , data }
33
- }
34
- }
35
-
36
29
const { lunrLanguages, configureLunr } = await import ( './main.js' ) . then ( m => m . default ) as DocfxOptions
37
30
38
31
if ( lunrLanguages && lunrLanguages . length > 0 ) {
@@ -41,6 +34,13 @@ async function loadIndexCore() {
41
34
await Promise . all ( lunrLanguages . map ( initLanguage ) )
42
35
}
43
36
37
+ if ( etag ) {
38
+ const value = JSON . parse ( await get ( 'index' , cache ) || '{}' )
39
+ if ( value && value . etag === etag ) {
40
+ return { index : lunr . Index . load ( value ) , data }
41
+ }
42
+ }
43
+
44
44
const index = lunr ( function ( ) {
45
45
lunr . tokenizer . separator = / [ \s \- . ( ) ] + /
46
46
You can’t perform that action at this time.
0 commit comments