修复静态页面开启时,文章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

@@ -124,7 +124,7 @@ export async function getStaticProps({ params: { prefix }, locale }) {
let fullSlug = prefix
const from = `slug-props-${fullSlug}`
const props = await getGlobalData({ from, locale })
if (siteConfig('PSEUDO_STATIC', BLOG.PSEUDO_STATIC, props.NOTION_CONFIG)) {
if (siteConfig('PSEUDO_STATIC', false, props.NOTION_CONFIG)) {
if (!fullSlug.endsWith('.html')) {
fullSlug += '.html'
}
@@ -134,7 +134,7 @@ export async function getStaticProps({ params: { prefix }, locale }) {
props.post = props?.allPages?.find(p => {
return (
p.type.indexOf('Menu') < 0 &&
(p.slug === fullSlug || p.id === idToUuid(fullSlug))
(p.slug === prefix || p.id === idToUuid(prefix))
)
})