Skip to content

Commit 15cb4e1

Browse files
committed
fix(search): fix search paths for result links
1 parent c7a5851 commit 15cb4e1

File tree

3 files changed

+13
-19
lines changed

3 files changed

+13
-19
lines changed

content/search.njk

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff 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>

pagefind/generate.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,8 @@ const { index } = await pagefind.createIndex()
66

77
// Index milestones and tickets
88
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'
1511
})
1612

1713
// Write pagefind files

pagefind/init.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff 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+
}

0 commit comments

Comments
 (0)