shabegom / buttons

Buttons in Obsidian
The Unlicense
453 stars 47 forks source link

Failing to find template #196

Closed Balake closed 5 months ago

Balake commented 7 months ago

Not sure if my vault is setup incorrectly, but I can't get inserting a template to work. Here's some context:

```button
name Start task list
type line(42) template
action tasks

Upon inspection and some debugging, here's what I've found:

 folders[0] &&
    folders.forEach((folder) => {
        console.log(file.path.toLowerCase(), `${folder}/${templateFile}.md`);
        if (file.path.toLowerCase() === `${folder}/${templateFile}.md`) {
            found = true;
        }
});
Screenshot 2023-11-05 at 11 36 23 AM

So it looks like the file.path.toLowerCase() doesn't contain the leading / that's provided by the plugins settings.