Create Bases with Templater

Hey,

I’m trying to use Templater to create a template that can also generate a base. Unfortunately, my attempt to create the base via:

await tp.file.create_new(tp.file.find_tfile("landingpage/landing-base-template"), title + '-base.base', false, app.vault.getAbstractFileByPath("_data_/bases"));

failed because the file extension is not set to .base, but rather .base is written in the file name.
Does anyone have any idea how I can create a base with Templater?

You have to use the obsidian api, instead of the templater api:

<%*
const basePath = `Test.base`;

const baseContent =
`filters:
views:
  - type: table
    name: "Entries"
`;

await app.vault.create(basePath, baseContent);
_%>

Thanks for your reply. Unfortunately, I haven’t been able to try it out yet, but I’ll give it a go soon.