YAML Key for new notes

This commit is contained in:
Ozan Tellioglu 2023-04-01 01:16:30 +02:00
parent 91a1727fef
commit afcd66577b
2 changed files with 15 additions and 1 deletions

View file

@ -70,7 +70,12 @@ export class CreateNoteModal extends Modal {
---
`;
// Create the MD File and close the modal
await createNewMarkdownFile(this.plugin, defFolder, newFileName, defaultNewFileText);
await createNewMarkdownFile(
this.plugin,
defFolder,
newFileName,
this.plugin.settings.dateSource === 'yaml' ? defaultNewFileText : ''
);
thisModal.close();
} else {
new Notice('Folder couldnt be found in the Vault');

View file

@ -185,6 +185,15 @@ export class OZCalendarPluginSettingsTab extends PluginSettingTab {
containerEl.createEl('h2', { text: 'New Note Settings' });
containerEl.createEl('p', {
text: `
The plugin will add the YAML key and date to the newly created note using the date format provided above
if Date Source is YAML. However, auto YAML key generation for the notes is going to be disabled if you use
File Name as date source.
`,
cls: 'setting-item-description',
});
new Setting(this.containerEl)
.setName('Default Folder Location')
.setDesc('Select the default folder, under which the new files should be saved when use plugin + icon')