fix(theme): 修复 auto frontmatter 配置
This commit is contained in:
parent
1aa96afd07
commit
7769bc888f
@ -98,10 +98,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
.vp-doc > h1:first-of-type {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.vp-doc img {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
@ -194,36 +194,35 @@ export function resolveOptions(
|
||||
include: '**/{readme,README,index}.md',
|
||||
frontmatter: {},
|
||||
},
|
||||
toArray(localeOptions.blog?.include).length
|
||||
? {
|
||||
include: localeOptions.blog?.include,
|
||||
frontmatter: {
|
||||
...options.title !== false
|
||||
? {
|
||||
title(title: string, { relativePath }) {
|
||||
if (title)
|
||||
return title
|
||||
const basename = path.basename(relativePath || '', '.md')
|
||||
return basename
|
||||
},
|
||||
} as AutoFrontmatterObject
|
||||
: undefined,
|
||||
...baseFrontmatter,
|
||||
...options.permalink !== false
|
||||
? {
|
||||
permalink(permalink: string, { relativePath }) {
|
||||
if (permalink)
|
||||
return permalink
|
||||
const locale = resolveLocale(relativePath)
|
||||
const prefix = withBase(articlePrefix, locale)
|
||||
{
|
||||
include: localeOptions.blog?.include ?? ['**/*.md'],
|
||||
frontmatter: {
|
||||
...options.title !== false
|
||||
? {
|
||||
title(title: string, { relativePath }) {
|
||||
if (title)
|
||||
return title
|
||||
const basename = path.basename(relativePath || '', '.md')
|
||||
return basename
|
||||
},
|
||||
} as AutoFrontmatterObject
|
||||
: undefined,
|
||||
...baseFrontmatter,
|
||||
...options.permalink !== false
|
||||
? {
|
||||
permalink(permalink: string, { relativePath }) {
|
||||
if (permalink)
|
||||
return permalink
|
||||
const locale = resolveLocale(relativePath)
|
||||
const prefix = withBase(articlePrefix, locale)
|
||||
|
||||
return normalizePath(`${prefix}/${nanoid()}/`)
|
||||
},
|
||||
} as AutoFrontmatterObject
|
||||
: undefined,
|
||||
},
|
||||
},
|
||||
|
||||
return normalizePath(`${prefix}/${nanoid()}/`)
|
||||
},
|
||||
} as AutoFrontmatterObject
|
||||
: undefined,
|
||||
},
|
||||
}
|
||||
: '',
|
||||
{
|
||||
include: '*',
|
||||
frontmatter: {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user