What I’m trying to do
I’m having problems to render a link to a note from a view.js
file that is executed from a dataviewjs block.
This works but doesn’t allow me to provide a custom link text:
dv.el("a", dv.fileLink("2022-10-20"));
This shows the correct custom link text, but the link does not work:
dv.el("a", "back", {'attr': {'href': dv.fileLink("2022-10-20")}});
Any ideas?
Some context why I’m doing this:
In my daily notes I want to show a dynamically rendered header with links to next and previews days. The header is generated in the view file and linked to the note like this:
$= await dv.view("views/daily-note")
By not hardcoding the header I can modify the header any time and the changes will be in all daily notes.