Merge pull request #426 from tangly1024/bug/post-base-path

Bug/post base path
This commit is contained in:
tangly1024
2022-11-05 15:44:22 +08:00
committed by GitHub
2 changed files with 3 additions and 3 deletions

View File

@@ -31,8 +31,8 @@ const BLOG = {
CUSTOM_FONT_SANS: ['LXGW WenKai Screen'], // 自定义无衬线字体
CUSTOM_FONT_SERIF: ['LXGW WenKai Screen'], // 自定义衬线字体
// 图标字体
FONT_AWESOME_PATH: 'https://cdn.bootcdn.net/ajax/libs/font-awesome/5.15.4/css/all.min.css', // 图标库CDN 国内推荐BootCDN国外推荐 CloudFlare https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css
// 图标库CDN(可以直接改版本号)
FONT_AWESOME_PATH: 'https://cdn.bootcdn.net/ajax/libs/font-awesome/6.2.0/css/all.min.css',
BACKGROUND_LIGHT: '#eeeeee', // use hex value, don't forget '#' e.g #fffefc
BACKGROUND_DARK: '#000000', // use hex value, don't forget '#'

View File

@@ -71,7 +71,7 @@ async function getPageProperties(id, block, schema, authToken, tagOptions, siteI
properties.status = properties.status?.[0]
if (properties.type === 'Post') {
properties.slug = BLOG.POST_URL_PREFIX + '/' + (properties.slug ?? properties.id)
properties.slug = BLOG.POST_URL_PREFIX ? (BLOG.POST_URL_PREFIX + '/' + (properties.slug ?? properties.id)) : (properties.slug ?? properties.id)
} else {
properties.slug = (properties.slug ?? properties.id)
}