Skip to content

Commit

Permalink
fix: search on index pages
Browse files Browse the repository at this point in the history
  • Loading branch information
jxom committed Oct 24, 2024
1 parent d3998d2 commit 3844e62
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/fast-cycles-turn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"vocs": patch
---

Fixed search on index pages.
1 change: 1 addition & 0 deletions src/vite/utils/search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ export async function buildIndex({
const href = relFile
.replace(relative(baseDir, resolve(baseDir, 'pages')), '')
.replace(/\.(.*)/, '')
.replace(/\/index$/, '')

const document = sections.map((section) => ({
href: `${href}#${section.anchor}`,
Expand Down

0 comments on commit 3844e62

Please sign in to comment.