Is there a way to pin daily note in the sidebar and automatically renew each day?

@Monohponic you can do it like this, which I suggested to someone who wanted to embed today’s note into a Canvas. You can drag the note into your sidebar and have it always update with today’s note:

If you put this code into a note (including the first line), every time that note is visible on your screen the Dataview code will execute and update the embed link to be the current date.

This also works fine from a canvas and automatically updates the embedded note just from viewing the canvas.

Note: You will need to update my date format YYYY-MM-DD dddd to match the one you’re using.

![[2023-09-27 Wednesday]]%%embed%%

```dataviewjs
// The date format for your periodic/daily notes
const dateFormat = 'YYYY-MM-DD dddd'
// Get the current file
const file = app.vault.getAbstractFileByPath(dv.current().file.path)
// Get the text contents of the current file
let contents = await app.vault.read(file)
// Update any text on the line before %%embed%% to be an embedded link to today's note
contents = contents.replace(/^.*?%%embed%%$/m, '![[' + moment().format(dateFormat) + ']]%%embed%%')
// Save the new contents back to the current file
await app.vault.modify(file, contents)
```
1 Like