From 550fabb9671016168f5c636210948e2e75d39a8e Mon Sep 17 00:00:00 2001 From: "tangly1024.com" Date: Thu, 27 Jun 2024 09:38:42 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=AC=AC=E4=BA=8C=E9=A1=B5ur?= =?UTF-8?q?l?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/notion/getPageProperties.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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) } // 如果跳转链接是多语言,则在新窗口打开