From 2bb2de45c96e497a46d7549d66691a04813d141d Mon Sep 17 00:00:00 2001 From: Ahad Birang Date: Thu, 4 Aug 2022 21:19:31 +0430 Subject: [PATCH] fix(content-index): files in `content` directory has higher priority --- src/runtime/server/content-index.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/runtime/server/content-index.ts b/src/runtime/server/content-index.ts index 897ef9b99..cf7331e3c 100644 --- a/src/runtime/server/content-index.ts +++ b/src/runtime/server/content-index.ts @@ -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)