In this my hope is for it to pull the contents of my daily journal using Transclusion.
In this way, when I write my Weekly Journal entry, I’m not forced to go and copy/paste each of my Daily Journal entries into the Weekly Journal – it simply shows the daily entries there automatically.
To achieve this, I’m using the Templater plugin which allows me to use: <%+ tp.date.now("YYYY-MM-DD") %>
This expresses as: 2023-05-22
If I then instead use: ![[<%+ tp.date.now("YYYY-MM-DD", -6) %>]]
My hope was that the weekly note would look for a note named: “2023-05-22” and show it’s contents using Transclusion
When I switch to reading mode, it does in fact say: “2023-05-16” is not created yet. Click to create."
This to me looks like success! Because I figured that if I simply had a note named “2023-05-22” it would show it’s contents.
However, when I created such a note, it still showed “2023-05-16” is not created yet. Click to create." and when I clicked it, it instead tried to create a new note with the title: “<%+ tp.date.now(“YYYY-MM-DD”) %>”
I did however have trouble implementing it, I even took your description and my question to ChatGPT to try to make sense of why it isn’t working.
The first problem I have I suppose is that we’re doing the opposite of one another.
I’d like to have a Weekly Journal Template which creates me a Weekly Journal entry titled in the 2023-W20 format, which automatically transcludes the entire Daily Journal for every day within that week, so 2023-05-15 through 2023-05-21.
My thinking of how it would work, is that when I create the Weekly Journal, the code will look at the title, being “2023-W20” and then calculate the seven required transclusions, and they’d need to be formatted as: “![[2023-05-15]]” and so on.
However, in an effort to try to better understand your way of doing things, I tried to replicate your method verbatim and came across an error, which stated:
" <% moment (tp. file.title, ‘yyyy-MM-dd’).startOf(‘week’).format(‘999g-[W]ww’)
%>#Aandachtspunten <% moment(tp. file.title, ‘yyyy-MM-dd’).startOf(‘week’).format(‘gggg-
[Www’) %>" is not created yet. Click to create.
I think a problem you are having is you are using dynamic templater commands whereas you should be using execution commands instead. That way when you create your weekly note it will actually insert the text rather than just displaying it to you.
I do the same thing in my weekly journal. I can add an example later to show you how I manage it if you still need the help.
To further exoand upon the last response; Templater works in three different modes, and this is controlled by the leading characters of your template block:
<% – The normal variant, which I think you should be using on this case. Here the template will be replaced when you insert the template (or create a file based upon the template)
<%+ – This kind of template blocks are kept as is into the resulting file, and are expanded when you enter reading mode (and not live-preview). Doing this within a link text, is somewhat sketchy and can result in malformations like you’ve already experienced.
So remove the plus sign from your template, and most likely it should work just nicely, and you’ll embed your daily notes from that weekly summary.
As you can see in the screenshot below, the code I’m using is working perfectly except that it’s titling each section with “Monday” instead of providing the correct day of the week, for the subsequent block.