Fixed upload file remove yaml info

This commit is contained in:
chris
2022-05-24 00:34:48 +08:00
parent ed32ed23a8
commit add4313284

View File

@@ -45,7 +45,9 @@ export class Upload2Notion {
} }
async syncMarkdownToNotion(title:string, markdown: string, fullPath:string): Promise<any> { async syncMarkdownToNotion(title:string, markdown: string, fullPath:string): Promise<any> {
const file2md = markdownToBlocks(markdown); const yamlObj:any = yamlFrontMatter.loadFront(markdown);
const __content = yamlObj.__content
const file2md = markdownToBlocks(__content);
const res = await this.createPage(title, file2md); const res = await this.createPage(title, file2md);
if (res.status === 200) { if (res.status === 200) {
this.updateYamlInfo(markdown, fullPath, res) this.updateYamlInfo(markdown, fullPath, res)