This means I have to manually remove the backslashes after creating a new weekly note.
Does anybody have an idea how to unescape the handlebars?
I looked at and around the template language docs but haven’t found the answer Template Language
PS: The reason I’m passing in the week start is that the live templating apparently doesn’t support the editor page name syscalls so I can’t ask for the page name of the weekly note.
Just to know whether I understand you correctly, are you trying to place a template inside a page template so that the inner template gets rendered on all new pages created using the page template?
If you place {{weeklyJournalSummary("2025-01-20")}} directly in the page template, without the ```template enclosure, that should render the weeklyJournalSummary() function on all pages created using this page template. Is that what you are trying to achieve?
@bent0n darn, I take it back. escapeDirective doesn’t solve the problem AFAICT since I still face the issue with nested handlebars.
The issue is that I need the inner handlebars to be evaluated at the time when I turn the page template into a page.
In other words,escapeDirective(weeklyJournalSummary("{{weekStart}}")) doesn’t work and I need the weekStart to turn into 2025-01-20when the template becomes a page, otherwise the weekStart will be dynamic and after a week I see different results in my old weekly note.
I’m starting to thing that I’m approaching this from a wrong angle and I probably don’t know enough about the template language and the syscalls to find a more elegant solution.
EDIT: I can’t render the whole weeklyJournalSummary when turn the template into a page because I create the weekly page on Monday, but I want the query to be dynamically updated for the whole week.
You could make the weekstart remain dynamic but have the output dependent on the filename to solve your issue? It seems you name the file with the date your interested in…
edit: Or even easier, use the filename as input to your weeklySummary function
@bent0n That was the first thing I wanted to do, but think that live templates don’t support the syscall
PS: The reason I’m passing in the week start is that the live templating apparently doesn’t support the editor page name syscalls so I can’t ask for the page name of the weekly note.
I tried it again and when I use
const date = await editor.getCurrentPage();
in my spacescript function
Error rendering template Error: Unregistered syscall editor.getCurrentPage
at data:application/javascript;base64,dmFyIERlPU9iamVjdC5k......dHtyaSBhcyBwbHVnfTsK:1:958
at data:application/javascript;base64,dmFyIERlPU9iamVjdC5k......dHtyaSBhcyBwbHVnfTsK:1:1006
at innerInvokeEventListeners (ext:deno_web/02_event.js:757:7)
at invokeEventListeners (ext:deno_web/02_event.js:804:5)
at dispatch (ext:deno_web/02_event.js:661:9)
at dispatchEvent (ext:deno_web/02_event.js:1041:12)
at pollForMessages (ext:runtime_main/js/99_main.js:218:7)
at eventLoopTick (ext:core/01_core.js:175:7)