diff --git a/src/methods/publishPost.ts b/src/methods/publishPost.ts index 1080c05..aa6fac6 100644 --- a/src/methods/publishPost.ts +++ b/src/methods/publishPost.ts @@ -35,7 +35,7 @@ export const publishPost = async ( }); // get frontmatter - const noteFile = app.workspace.getActiveFile(); + const noteFile = view.app.workspace.getActiveFile(); const metaMatter = app.metadataCache.getFileCache(noteFile).frontmatter; const data = matter(view.getViewData());