fix bug: 自定义数据库type字段属性后无法正确生成未显式定义slug的文章的路径

处理URL之前已经调用过mapProperties(properties),使得字段属性值恢复到标准的英文了,不应当再与自定义配置值进行比对
This commit is contained in:
葉修齊
2024-01-26 21:59:33 +08:00
committed by GitHub
parent 156ed85959
commit 849e043103

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 ?? ''