My template immediately starts with a code block that prompts for user input then moves the new file. Under that is frontmatter that includes a variable created in the previous code block.
When i create a new file with this template, the frontmatter is preceded by a single line break, when i expect it to start with “—”. It’s as if the first code block is replaced with a linebreak for some reason.
Does anyone know why this occurs, and how i can work around it?
Below is my template:
<%*
let dateOfSession = await tp.system.prompt("Date of Session:", tp.file.creation_date("DD/MM/YYYY"))
await tp.file.move("/Meetings/Therapy/" + dateOfSession + " - Therapy")
%>
<%"---"%>
Date: <% dateOfSession %>
Last Session:
Paid: false
<%"---"%>
And here is the result:
---
Date: 28/12/2023
Last Session:
Paid: false
---