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
8
8
<hr >
9
9
10
10
<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()
6
6
7
7
// Index milestones and tickets
8
8
await 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'
15
11
} )
16
12
17
13
// Write pagefind files
Original file line number Diff line number Diff line change @@ -6,3 +6,14 @@ new PagefindUI({
6
6
zero_results : 'No matches found.'
7
7
}
8
8
} )
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