Various AT Protocol integrations with obsidian
20
fork

Configure Feed

Select the types of activity you want to include in your feed.

enable via settings

+20 -1
+1 -1
src/commands/publishDocument.ts
··· 102 102 publishedAt = fm["publishedAt"]; // Preserve existing if updating 103 103 } 104 104 105 - if (!title) { 105 + if (!title && plugin.settings.publish.useFirstHeaderAsTitle) { 106 106 title = extractFirstH1(content); 107 107 } 108 108
+19
src/settings.ts
··· 5 5 identifier: string; 6 6 appPassword: string; 7 7 clipDir: string; 8 + publish: { 9 + useFirstHeaderAsTitle: boolean; 10 + }; 8 11 } 9 12 10 13 export const DEFAULT_SETTINGS: AtProtoSettings = { 11 14 identifier: "", 12 15 appPassword: "", 13 16 clipDir: "AtmosphereClips", 17 + publish: { 18 + useFirstHeaderAsTitle: false, 19 + } 14 20 }; 15 21 16 22 export class SettingTab extends PluginSettingTab { ··· 50 56 await this.plugin.saveSettings(); 51 57 }); 52 58 }); 59 + 53 60 new Setting(containerEl) 54 61 .setName("Clip directory") 55 62 .setDesc("Directory in your vault to save clips (will be created if it doesn't exist)") ··· 58 65 .setValue(this.plugin.settings.clipDir) 59 66 .onChange(async (value) => { 60 67 this.plugin.settings.clipDir = value; 68 + await this.plugin.saveSettings(); 69 + }) 70 + ); 71 + 72 + new Setting(containerEl) 73 + .setName("Use first header as publish title") 74 + .setDesc('When enabled and no "title" property is set, first markdown level 1 header will be used as the title of the published document. If disabled, the title will default to the note filename.') 75 + .addToggle((toggle) => 76 + toggle 77 + .setValue(this.plugin.settings.publish.useFirstHeaderAsTitle) 78 + .onChange(async (value) => { 79 + this.plugin.settings.publish.useFirstHeaderAsTitle = value; 61 80 await this.plugin.saveSettings(); 62 81 }) 63 82 );