Skip to content

Commit

Permalink
fix(search): fix search paths for result links
Browse files Browse the repository at this point in the history
  • Loading branch information
timmywil committed Sep 26, 2024
1 parent c7a5851 commit 15cb4e1
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 19 deletions.
13 changes: 0 additions & 13 deletions content/search.njk
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,3 @@ layout: layouts/base.njk
<hr>

<div id="full-page-search"></div>

<script>
window.addEventListener('DOMContentLoaded', (event) => {
new PagefindUI({
element: "#full-page-search",
showImages: false,
translations: {
placeholder: 'Search all tickets and milestones',
zero_results: 'No matches found.'
}
})
})
</script>
8 changes: 2 additions & 6 deletions pagefind/generate.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,8 @@ const { index } = await pagefind.createIndex()

// Index milestones and tickets
await index.addDirectory({
path: '_site/milestone',
glob: '**/*.html'
})
await index.addDirectory({
path: '_site/ticket',
glob: '**/*.html'
path: '_site',
glob: '{milestone,ticket}/**/*.html'
})

// Write pagefind files
Expand Down
11 changes: 11 additions & 0 deletions pagefind/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,14 @@ new PagefindUI({
zero_results: 'No matches found.'
}
})

if (document.getElementById('full-page-search')) {
new PagefindUI({
element: '#full-page-search',
showImages: false,
translations: {
placeholder: 'Search all tickets and milestones',
zero_results: 'No matches found.'
}
})
}

0 comments on commit 15cb4e1

Please sign in to comment.