Merge pull request #2536 from tangly1024/fix/article-url-in-page-2

修复第二页url
This commit is contained in:
tangly1024
2024-06-27 09:39:17 +08:00
committed by GitHub

View File

@@ -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)
}
// 如果跳转链接是多语言,则在新窗口打开