From e96fb21558648cd99e0001318284e0b61acb1922 Mon Sep 17 00:00:00 2001 From: Christian Georgi Date: Thu, 31 Aug 2023 10:34:55 +0200 Subject: [PATCH] Restore order in index page (#391) This got broken with 98e4566, so that during sorting, we compared paths with and without base paths. --- .vitepress/theme/components/indexFilter.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.vitepress/theme/components/indexFilter.js b/.vitepress/theme/components/indexFilter.js index 87cd988f3..6202981eb 100644 --- a/.vitepress/theme/components/indexFilter.js +++ b/.vitepress/theme/components/indexFilter.js @@ -1,9 +1,10 @@ -const { themeConfig: { sidebar }} = global.VITEPRESS_CONFIG.site +const { base, themeConfig: { sidebar }} = global.VITEPRESS_CONFIG.site +import { join } from 'node:path' export default (pages, basePath) => { let items = findInItems(basePath, sidebar) || [] items = items.map(item => { return { ...item, link: item.link.replace(/\.md$/, '') }}) - const itemLinks = items.map(item => item.link) + const itemLinks = items.map(item => join(base, item.link)) return pages .map(p => {