支持外部链接跳转

This commit is contained in:
tangly1024
2022-03-08 15:24:57 +08:00
parent 3e22d62af5
commit e2502981ce
2 changed files with 8 additions and 2 deletions

View File

@@ -97,7 +97,11 @@ async function getCustomNav ({ notionPageData }) {
const customNav = []
if (allPage && allPage.length > 0) {
allPage.forEach(p => {
customNav.push({ icon: p.icon || null, name: p.title, to: '/' + p.slug, show: true })
if (p?.slug?.indexOf('http') === 0) {
customNav.push({ icon: p.icon || null, name: p.title, to: p.slug, show: true })
} else {
customNav.push({ icon: p.icon || null, name: p.title, to: '/' + p.slug, show: true })
}
})
}
return customNav