File tree Expand file tree Collapse file tree 3 files changed +13
-19
lines changed
Expand file tree Collapse file tree 3 files changed +13
-19
lines changed Original file line number Diff line number Diff line change @@ -8,16 +8,3 @@ layout: layouts/base.njk
88<hr >
99
1010<div id =" full-page-search" ></div >
11-
12- <script >
13- window .addEventListener (' DOMContentLoaded' , (event ) => {
14- new PagefindUI ({
15- element: " #full-page-search" ,
16- showImages: false ,
17- translations: {
18- placeholder: ' Search all tickets and milestones' ,
19- zero_results: ' No matches found.'
20- }
21- })
22- })
23- </script >
Original file line number Diff line number Diff line change @@ -6,12 +6,8 @@ const { index } = await pagefind.createIndex()
66
77// Index milestones and tickets
88await index . addDirectory ( {
9- path : '_site/milestone' ,
10- glob : '**/*.html'
11- } )
12- await index . addDirectory ( {
13- path : '_site/ticket' ,
14- glob : '**/*.html'
9+ path : '_site' ,
10+ glob : '{milestone,ticket}/**/*.html'
1511} )
1612
1713// Write pagefind files
Original file line number Diff line number Diff line change @@ -6,3 +6,14 @@ new PagefindUI({
66 zero_results : 'No matches found.'
77 }
88} )
9+
10+ if ( document . getElementById ( 'full-page-search' ) ) {
11+ new PagefindUI ( {
12+ element : '#full-page-search' ,
13+ showImages : false ,
14+ translations : {
15+ placeholder : 'Search all tickets and milestones' ,
16+ zero_results : 'No matches found.'
17+ }
18+ } )
19+ }
You can’t perform that action at this time.
0 commit comments