Merge pull request #2550 from tangly1024/fix/url-prefix-empty-to-open

修复配置了prefix后,部分页面无法打开的bug
This commit is contained in:
tangly1024
2024-06-28 17:38:31 +08:00
committed by GitHub
2 changed files with 10 additions and 5 deletions

View File

@@ -290,5 +290,10 @@ function generateCustomizeSlug(postProperties, NOTION_CONFIG) {
if (fullPrefix.endsWith('/')) { if (fullPrefix.endsWith('/')) {
fullPrefix = fullPrefix.substring(0, fullPrefix.length - 1) // 去掉尾部部的"/" fullPrefix = fullPrefix.substring(0, fullPrefix.length - 1) // 去掉尾部部的"/"
} }
if(fullPrefix){
return `${fullPrefix}/${postProperties.slug ?? postProperties.id}` return `${fullPrefix}/${postProperties.slug ?? postProperties.id}`
}else{
return `${postProperties.slug ?? postProperties.id}`
}
} }