mirror of
https://github.com/lostpaul/obsidian-folder-notes.git
synced 2026-07-22 07:40:24 +00:00
Fix templater vars
This commit is contained in:
parent
805fc8ac77
commit
fedddcaa84
2 changed files with 7 additions and 5 deletions
|
|
@ -82,9 +82,13 @@ export async function createFolderNote(plugin: FolderNotesPlugin, folderPath: st
|
|||
});
|
||||
}
|
||||
|
||||
if (!extension) {
|
||||
extension = folderNoteType;
|
||||
}
|
||||
|
||||
if (!folderNote) {
|
||||
let content = '';
|
||||
if (extension !== '.md') {
|
||||
if (extension !== '.md' && extension) {
|
||||
if (plugin.settings.templatePath && folderNoteType.split('.').pop() === plugin.settings.templatePath.split('.').pop()) {
|
||||
const templateFile = plugin.app.vault.getAbstractFileByPath(plugin.settings.templatePath);
|
||||
if (templateFile instanceof TFile) {
|
||||
|
|
|
|||
|
|
@ -31,8 +31,6 @@ export class TemplateSuggest extends AbstractInputSuggest<TFile> {
|
|||
const lower_input_str = input_str.toLowerCase();
|
||||
|
||||
if ((!templateFolder || templateFolder.trim() === '') && !templaterPlugin) {
|
||||
console.log('Template folder not found');
|
||||
console.log(lower_input_str);
|
||||
files = this.plugin.app.vault.getFiles().filter((file) =>
|
||||
file.path.toLowerCase().includes(lower_input_str)
|
||||
);
|
||||
|
|
@ -61,9 +59,9 @@ export class TemplateSuggest extends AbstractInputSuggest<TFile> {
|
|||
const { templateFolder, templaterPlugin } = getTemplatePlugins(this.app);
|
||||
|
||||
if ((!templateFolder || templateFolder.trim() === '') && !templaterPlugin) {
|
||||
el.setText(`${file.parent?.path}/${file.name.replace('.md', '')}`);
|
||||
el.setText(`${file.parent?.path !== '/' ? file.parent?.path + '/' : ''}${file.name}`);
|
||||
} else {
|
||||
el.setText(file.name.replace('.md', ''));
|
||||
el.setText(file.name);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue