fix: fix logic to correspond with config change

pull/85/head
小倉優悟 5 years ago
parent 901bd4ef3f
commit 197bf351ee

@ -145,9 +145,14 @@ function getNextAndPrev(themeConfig: any, pagePath: string) {
if (!sidebarItem.children) {
return
}
sidebarItem.children.forEach((candidate: any) => {
candidates.push(candidate)
sidebarItem.children.forEach(
(candidate: { text: string; link: string }) => {
candidates.push({
text: candidate.text,
link: convertToAbsolutePath(candidate.link)
})
}
)
})
})
@ -166,6 +171,13 @@ function getNextAndPrev(themeConfig: any, pagePath: string) {
}
}
function convertToAbsolutePath(path: string) {
if (!path.startsWith('/')) {
return `/${path}`
}
return path
}
export async function createServer(options: ServerConfig = {}) {
const config = await resolveConfig(options.root)

Loading…
Cancel
Save