Merge pull request #1817 from siuze/patch-1

fix bug: 自定义数据库type字段属性后无法正确生成未显式定义slug的文章的路径
This commit is contained in:
tangly1024
2024-01-30 18:19:15 +08:00
committed by GitHub

View File

@@ -101,11 +101,11 @@ export default async function getPageProperties(id, block, schema, authToken, ta
delete properties.content
// 处理URL
if (properties.type === BLOG.NOTION_PROPERTY_NAME.type_post) {
if (properties.type === 'Post') {
properties.slug = (BLOG.POST_URL_PREFIX) ? generateCustomizeUrl(properties) : (properties.slug ?? properties.id)
} else if (properties.type === BLOG.NOTION_PROPERTY_NAME.type_page) {
} else if (properties.type === 'Page') {
properties.slug = properties.slug ?? properties.id
} else if (properties.type === BLOG.NOTION_PROPERTY_NAME.type_menu || properties.type === BLOG.NOTION_PROPERTY_NAME.type_sub_menu) {
} else if (properties.type === 'Menu' || properties.type === 'SubMenu') {
// 菜单路径为空、作为可展开菜单使用
properties.to = properties.slug ?? '#'
properties.name = properties.title ?? ''