Skip to content

Commit

Permalink
fix: cannot parse title from front matter
Browse files Browse the repository at this point in the history
  • Loading branch information
jxpeng98 committed Oct 22, 2024
1 parent 3218eb9 commit 5942876
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/upload/upoload_custom/getMarkdownCustom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ export async function getNowFileMarkdownContentCustom(

// If a 'title' type property exists, use the file's basename as its value
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) {
Expand Down

0 comments on commit 5942876

Please sign in to comment.