fix(docs): bad next page

This commit is contained in:
Neko Ayaka
2025-07-17 00:20:03 +08:00
parent d66f9d3e90
commit 4e3f13ffd2
+7 -2
View File
@@ -1,4 +1,4 @@
import { useData } from 'vitepress'
import { useData, withBase } from 'vitepress'
import { computed } from 'vue'
import { getFlatSideBarLinks, getSidebar, isActive } from './sidebar'
@@ -14,7 +14,12 @@ export function usePrevNext() {
const candidates = uniqBy(links, link => link.link.replace(/[?#].*$/, ''))
const index = candidates.findIndex((link) => {
return isActive(page.value.relativePath, link.link)
let path = page.value.relativePath
if (path.startsWith('/')) {
path = path.slice(1)
}
return isActive(withBase(`/${path}`), link.link)
})
const hidePrev