Skip to content

Commit

Permalink
Restore order in index page (#391)
Browse files Browse the repository at this point in the history
This got broken with 98e4566, so that during sorting, we compared paths
with and without base paths.
  • Loading branch information
chgeo authored Aug 31, 2023
1 parent 54fb78b commit e96fb21
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions .vitepress/theme/components/indexFilter.js
Original file line number Diff line number Diff line change
@@ -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 => {
Expand Down

0 comments on commit e96fb21

Please sign in to comment.