How to get specific journal prompts for every day of the year (perennial calendar journal)

So in essence you want to copy some template into the current daily note based upon the day of the year. Then you need to store these templates somewhere.

Some alternatives on how to store these templates:

  • Pure javascript dicitionaries
  • Markdown lists with fields
  • Dedicated files

Using javascript

```dataviewjs

const dayOfYear = {
  "Jan 1" : "A new year has started",
  // ...
  "Oct 17" : "The glorious day of October 17th",
  "Oct 18" : "A not so glorious day?!",
  //...
  "Dec 31" : "A new year is about to happen..."
}

const today = (new DateTime("today")).toFormat("LLL d")

dv.span(dayOfYear[today])
```

This approach can be adapted into using Templater’s javascript code blocks, and thusly insert random template strings. But it’s easiest done for shorter amount of texts.

Using lists in another file

Another similar option could be to have lists like the following:

- ...
- [date:: "Oct 17"] [template:: "Your template text for October 17th"]
- [date:: "Oct 17"] [template:: "Your template text for October 18th"]
- ...

Has the same kind of limitations as presenting it directly in javascript that it’s best suited for shorter amount of text. Advantage here is that it can be viewed and queried within Obsidian in various ways, like using dataview

Using dedicated files

If you want larger texts, and possible other templating options I feel the better overall option is to use a dedicated folder with one template file for each day, and then if using Templater use tp.file.include() to include that file. Then any template code in the resulting file would also be executed/expanded upon.


In either case you can write a general template to include the day of the year template accordingly to how I select today in the javascript section. That way you’d end up with 367 “templates”, one which is used by the create the daily note, and 366 for each of the day of the year (including the leap year).

In most cases though, you’ll never think about the individual templates as the code to handle/choose those templates are generic and called from the main template.

2 Likes