diff --git a/lib/notion/getPageProperties.js b/lib/notion/getPageProperties.js index 5579e6b8..95796c2f 100644 --- a/lib/notion/getPageProperties.js +++ b/lib/notion/getPageProperties.js @@ -188,7 +188,7 @@ export function adjustPageProperties(properties, NOTION_CONFIG) { } // http or https 开头的视为外链 - if (checkStartWithHttp(properties?.slug)) { + if (checkStartWithHttp(properties?.href)) { properties.href = properties?.slug properties.target = '_blank' } else { @@ -197,7 +197,6 @@ export function adjustPageProperties(properties, NOTION_CONFIG) { if (siteConfig('PSEUDO_STATIC', false, NOTION_CONFIG)) { if ( !properties?.href?.endsWith('.html') && - !properties?.href?.startsWith('http') && properties?.href !== '' && properties?.href !== '#' && properties?.href !== '/' @@ -205,8 +204,9 @@ export function adjustPageProperties(properties, NOTION_CONFIG) { properties.href += '.html' } } + // 相对路径转绝对路径:url左侧拼接 / - convertUrlStartWithOneSlash(properties?.href) + properties.href = convertUrlStartWithOneSlash(properties?.href) } // 如果跳转链接是多语言,则在新窗口打开