feat: support yaml slug

This commit is contained in:
DIYgod 2023-07-22 14:59:55 +01:00
parent 06713c901e
commit dba68e1012
No known key found for this signature in database
1 changed files with 3 additions and 1 deletions

View File

@ -41,7 +41,9 @@ export const readFiles = async (files: FileList) => {
pageContent.frontMatter.date || file.lastModified || Date.now(),
).toISOString(),
slug:
pageContent.frontMatter.permalink || getDefaultSlug(file.name),
pageContent.frontMatter.permalink ||
pageContent.frontMatter.slug ||
getDefaultSlug(file.name),
tags: makeArray(
pageContent.frontMatter.tags ||
pageContent.frontMatter.categories,