From 0df92b2054768a5e5a8b22699c6007f3281790b2 Mon Sep 17 00:00:00 2001 From: Manoah Tervoort <46671786+mtdvlpr@users.noreply.github.com> Date: Wed, 10 Apr 2024 09:09:36 +0200 Subject: [PATCH] fix(useCollection): use base url in index finder --- client/use-collection.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/use-collection.js b/client/use-collection.js index c4b61c9..a67e950 100644 --- a/client/use-collection.js +++ b/client/use-collection.js @@ -8,11 +8,11 @@ import {data as collections} from './collections.data.js'; export default function useCollection(type = undefined) { const route = useRoute(); const path = route.path; - const {theme} = useData(); + const {site, theme} = useData(); const themeTags = theme.value?.tags ?? {}; function findCurrentIndex() { - const result = pages.findIndex(p => p.url === route.path); + const result = pages.findIndex(p => `${site.value?.base ?? ''}${p.url}`.replace(/\/+/g, '/') === route.path); if (result === -1) console.error(`content missing: ${route.path}`); return result; }