File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 1
1
// Patch Doks' builtin flexsearch implementation so that it resolves the search index correctly when deployed to a
2
2
// subdirectory. Original code: https://github.com/gethyas/doks-core/blob/main/assets/js/flexsearch.js.
3
3
//
4
- // The only line changed compared to the original code above is L133 ; see comment there.
4
+ // The only line changed compared to the original code above is L134 ; see comment there.
5
5
6
6
/*!
7
7
* FlexSearch for Bootstrap based Hyas sites
@@ -129,8 +129,9 @@ import Index from 'flexsearch';
129
129
function buildIndex ( ) {
130
130
document . querySelector ( '.search-loading' ) . classList . remove ( 'd-none' ) ;
131
131
132
- // Originally `fetch("{{ site.LanguagePrefix }}/search-index.json")`; our patch prefixes with {{ site.BaseURL }}.
133
- fetch ( "{{ site.BaseURL }}{{ site.LanguagePrefix }}/search-index.json" )
132
+ // Originally `fetch("{{ site.LanguagePrefix }}/search-index.json")`; our patch resolves the search index relative
133
+ // to the base URL of the deployment.
134
+ fetch ( "{{ relURL `search-index.json` }}" )
134
135
. then ( function ( response ) {
135
136
return response . json ( ) ;
136
137
} )
You can’t perform that action at this time.
0 commit comments