fix: more fix for netlify

pull/130/head
Kia Ishii 5 years ago
parent c06435dab3
commit f7c972317c

@ -15,10 +15,9 @@ export function useNextAndPrevLinks() {
}) })
const currentPath = computed(() => { const currentPath = computed(() => {
return ensureStartingSlash(page.value.relativePath).replace( const path = ensureStartingSlash(page.value.relativePath)
/(index)?\.(md|html)$/,
'' return path.replace(/(index)?\.(md|html)$/, '')
)
}) })
const currentIndex = computed(() => { const currentIndex = computed(() => {
@ -29,7 +28,7 @@ export function useNextAndPrevLinks() {
const next = computed(() => { const next = computed(() => {
if ( if (
site.value.themeConfig?.nextLinks !== false && site.value.themeConfig.nextLinks !== false &&
currentIndex.value > -1 && currentIndex.value > -1 &&
currentIndex.value < candidates.value.length - 1 currentIndex.value < candidates.value.length - 1
) { ) {
@ -38,7 +37,7 @@ export function useNextAndPrevLinks() {
}) })
const prev = computed(() => { const prev = computed(() => {
if (site.value.themeConfig?.prevLinks !== false && currentIndex.value > 0) { if (site.value.themeConfig.prevLinks !== false && currentIndex.value > 0) {
return candidates.value[currentIndex.value - 1] return candidates.value[currentIndex.value - 1]
} }
}) })

Loading…
Cancel
Save