File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -9,10 +9,18 @@ let hotKeys = [
99 "/" ,
1010] ;
1111
12- docsearch ( {
13- container : "#docsearch" ,
14- host : "https://search.statamic.dev" ,
15- apiKey : "a8b8f82076221f9595dceca971be29c36cbccd772de5dbdb7f43dfac41557f95" ,
16- indexUid : `docs-${ import . meta. env . VITE_STATAMIC_DOCS_VERSION } ` ,
17- hotKeys : hotKeys ,
18- } ) ;
12+ function initDocsearch ( ) {
13+ const container = document . querySelector ( "#docsearch" ) ;
14+ if ( ! container || container . childElementCount > 0 ) return ;
15+
16+ docsearch ( {
17+ container : "#docsearch" ,
18+ host : "https://search.statamic.dev" ,
19+ apiKey : "a8b8f82076221f9595dceca971be29c36cbccd772de5dbdb7f43dfac41557f95" ,
20+ indexUid : `docs-${ import . meta. env . VITE_STATAMIC_DOCS_VERSION } ` ,
21+ hotKeys : hotKeys ,
22+ } ) ;
23+ }
24+
25+ initDocsearch ( ) ;
26+ document . addEventListener ( "livewire:navigated" , initDocsearch ) ;
You can’t perform that action at this time.
0 commit comments