Skip to content

Commit

Permalink
fix(content-index): files in content directory has higher priority (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
farnabaz authored Aug 4, 2022
1 parent c71c79b commit cacee66
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/runtime/server/content-index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ export async function getContentIndex (event: CompatibilityEvent) {
const data = await serverQueryContent(event).find()

contentIndex = data.reduce((acc, item) => {
acc[item._path!] = item._id
if (!acc[item._path!]) {
acc[item._path!] = item._id
} else if (item._id.startsWith('content:')) {
acc[item._path!] = item._id
}
return acc
}, {} as Record<string, string>)

Expand Down

0 comments on commit cacee66

Please sign in to comment.