fix: cannot parse title from front matter

This commit is contained in:
Jiaxin Peng
2024-10-22 10:27:33 +01:00
parent 3218eb9fba
commit 5942876c92

View File

@@ -35,7 +35,10 @@ export async function getNowFileMarkdownContentCustom(
// If a 'title' type property exists, use the file's basename as its value // If a 'title' type property exists, use the file's basename as its value
if (titleProperty) { if (titleProperty) {
customValues[titleProperty.customName] = nowFile.basename; // Use 'basename' for the file name without extension customValues[titleProperty.customName] =
(FileCache.frontmatter && FileCache.frontmatter[titleProperty.customName]) ?
FileCache.frontmatter[titleProperty.customName] : // use the front matter value if it exists
nowFile.basename; // Use 'basename' for the file name without extension
} }
} catch (error) { } catch (error) {