修复静态页面开启时,文章url前缀设为空无法访问的bug

This commit is contained in:
tangly1024.com
2024-06-04 10:23:01 +08:00
parent a7a81357fd
commit 0a5c8c6c27
4 changed files with 7 additions and 6 deletions

View File

@@ -19,7 +19,7 @@ export const siteConfig = (key, defaultVal = null, extendConfig = {}) => {
return null
}
// 特殊配置处理;某些配置只在服务端生效而Global的NOTION_CONFIG仅限前端组件使用因此需要从extendConfig中读取
// 特殊配置处理;以下配置只在服务端生效而Global的NOTION_CONFIG仅限前端组件使用因此需要从extendConfig中读取
switch (key) {
case 'NEXT_REVALIDATE_SECOND':
case 'POST_RECOMMEND_COUNT':

View File

@@ -187,7 +187,7 @@ export function adjustPageProperties(properties, NOTION_CONFIG) {
}
// 开启伪静态路径
if (JSON.parse(NOTION_CONFIG?.PSEUDO_STATIC || BLOG.PSEUDO_STATIC)) {
if (siteConfig('PSEUDO_STATIC', false, NOTION_CONFIG)) {
if (
!properties?.href?.endsWith('.html') &&
!properties?.href?.startsWith('http')