From 898496007f327c3f732afedaf8b0a6364c93375d Mon Sep 17 00:00:00 2001 From: wood chen Date: Wed, 5 Feb 2025 13:29:57 +0800 Subject: [PATCH] Use frontmatter title as post title when available - Modify post title generation to prefer frontmatter title - Fallback to filename if no frontmatter title is present --- src/main.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.ts b/src/main.ts index 1e21073..6106284 100644 --- a/src/main.ts +++ b/src/main.ts @@ -154,7 +154,7 @@ export default class DiscourseSyncPlugin extends Plugin { edit_reason: "Updated from Obsidian", tags: this.settings.selectedTags || [] } : { - title: this.activeFile.name, + title: (frontMatter?.title ? frontMatter?.title : this.activeFile.name), raw: content, category: this.settings.category, tags: this.settings.selectedTags || []