Templater Script breaks Header

What I’m trying to do

Im trying to setup a Template for Meeting Minutes that gets called when I create a new File in a specific Folder (Meeting Minutes).

That works, but does not edit the new file name, the new note is just called “Untitled”. Ive looked in this forum and came across the tp.file.rename() method wich fits my usecase. However, using that in my Template breaks the header of the new notes. It looks unformatted and for example the Participants and Tags are not removable bubbles anymore.
I havent found any Information about this however, and hope I find some here.

Things I have tried

This is the Template:


<%*
tp.file.rename(`Jour Fixe - ${tp.date.now("YYYY-MM-DD")}`)
%>
---
title: Jour Fixe Weekly Sync <% tp.date.now("dddd") %>
date: <% tp.date.now("YYYY-MM-DD") %>
time: <% tp.date.now("HH:mm") %>
participants:
  - Person A
  - Person B
  - Me
tags: [meeting], [Customer_Name]
---
## Topics

1. Topics

---

## Notes and Information

- Notes

I forgot to include the Output, here it is:

You might need to look at how white space control works with Templater :blush: … as frontmatters/YAML/Properties need to start on the very 1st line of a note for it to work as expected :blush:

https://silentvoid13.github.io/Templater/commands/whitespace-control.html

And I think, tp.file.rename() needs an await

So, instead of using this:

<%*
tp.file.rename(`Jour Fixe - ${tp.date.now("YYYY-MM-DD")}`)
%>

You might need something like this:

<%* await tp.file.rename(`Jour Fixe - ${tp.date.now("YYYY-MM-DD")}`) -%>

I’m also not sure the syntax for the value of the tags key is the right one :thinking: … but this seems to work though :blush: (after a very very quick test :innocent: )

<%* await tp.file.rename(`Jour Fixe - ${tp.date.now("YYYY-MM-DD")}`) -%>
---
title: Jour Fixe Weekly Sync <% tp.date.now("dddd") %>
date: <% tp.date.now("YYYY-MM-DD") %>
time: <% tp.date.now("HH:mm") %>
participants:
  - Person A
  - Person B
  - Me
tags:
  - meeting
  - Customer_Name
---
## Topics

1. Topics

---

## Notes and Information

- Notes

Hello Pch

amazing, thank you for the fast reply. That was a total oversight on my part. It seems like my Code editor has a CR-Flag on the first line that I didnt see.

Works as expected! Thank you again.

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.