7 min read

How to Set Up an Automated Daily Template in Logseq

The Journals page in Logseq is the best place to run your day from. But instead of improvising, why not set up a template?
How to Set Up an Automated Daily Template in Logseq

Templates are the best way to easily structure and link your notes in Logseq. Not only do templates provide structure, having consistent links means that you can more reliably find your notes using queries. This comes in handy when you want to build systems in Logseq.

There are many different ways Logseqers use templates on their Journals page. Personally, I have a daily template to track habits, have a place to write my morning pages, import calendar events, and have a simple inbox to capture anything else.

In this article, I'll show how to create templates and define a template that's loaded onto your Journals page every day. If you already know how to create templates in Logseq, you can skip the first section and head over to how to set a daily recurring template.

How to set up a Logseq template

Before we get started with the automation part, let's first have a look at setting up a template that you want to appear on the Journals page every day. In case you already have a daily template set up, you can skip this section.

I recommend you pick one page where you store all of your templates (e.g. [[templates]]). While it's possible to get an overview of all of your templates using a query, collecting all of them on one page makes management a lot easier.

Here are the three steps to set up a template in Logseq:

Step 1: Create a parent block

The best practice is to nest the template blocks underneath a parent block. This will make navigating the [[templates]] page much easier.

When creating the template trigger in the third step, you'll be able to set if you want to make this parent block part of the template or not. Many people who decide to include this parent block in their template often add links to it. This way, all blocks that are part of the template will be tagged with those links when you run the template. Keep this in mind as you structure your daily template.

Step 2: Add the template

Nested underneath the parent block you can add as many template blocks as you like. From a single block to hundreds; Logseq can handle them all.

In the Logseq documentation, you can find all the possibilities of templates. One popular feature are the dynamic variables which let you add date links using natural language (e.g. time or last Friday).

Step 3: Set the template name

Right-click on the parent block of the template and select the Make template option:

Next, fill in the name of the template. This will be the name that appears in the list when you run the /template command. This name will also be used in the configuration file, so it's best to not include special characters like emojis in the template name.

If you wish to include the parent block in the template, enable the option Including the parent block in the template . However, as we're creating a daily template, the best practice is to have a template with all blocks on the root level (minimum indentation level). In other words: I recommend not enabling this option.

When you're done, click the Submit button. You'll now see metadata added to the parent block:

That's it, you're now all set. You can even choose to not automate the process and just run the /template command manually each day.

How to set a daily recurring template

Have you set up a template you want to use every day? Great! Now let's see how to make it appear on the fresh Journals page you get every day at midnight.

Step 1: Open config.edn

The config.edn file is where your settings are saved. Anytime you change anything in the Logseq settings screen, they are saved to this file. However, config.edn has a few more options than are available via the interface.

To open the configuration file, open the search bar using the Cmd-k (macOS) / Ctrl-k (Windows, Linux) shortcut. Alternatively, click the 🔍 icon in the top menu bar. Now type config.edn, locate the result, and hit Enter:

The F in front of the name indicates it's a file

Another way to open the config.edn file is by opening the settings screen and clicking the Edit config.edn button from the General tab:

Step 2: Define the template

Look for the following lines (probably around 18-19) in the config.edn file:

 :default-templates
 {:journals ""}

Next, type the name of the template you want to use between the quotes:

Step 3: Refresh Logseq

For the changes to take effect you need to refresh Logseq. Either use the keyboard shortcut Cmd-r (macOS) / Ctrl-r (Windows, Linux), or click the Refresh option from the menu in the left sidebar:

That's it! You're now all set. Every day at midnight you'll get a new Journals page with the template already populated.

To test if the template works, empty today's Journals page (cut-paste onto another page if it already contains content). If the template does not appear, make you sure the only thing on the page is a single bullet that says Click here to edit... If the bullet has no text, place your cursor in the block, hit Esc and then Backspace or Delete on your keyboard. Now the template should appear within a few seconds. If that's not the case, check if you wrote the template name correctly in config.edn and is wrapped with double-quotes.

Having a daily structure is an excellent way to program your attention, so change the template as you see fit. To do so, you'll only need to head over to the [[templates]] page and change the template. Your new template will show up on the next day's Journals page.

Supercharge your daily template using plugins

Logseq is improving every day thanks to its plugin ecosystem. On the Marketplace (which you can find via the ... > Plugins option in the top menubar), there are several plugins that you can use in combination with a daily template. I'll highlight a few below.

The plugin names link to their respective GitHub pages. But no worries: you can install them in one click from the Marketplace.

Logseq Habit Tracker

Using a few hashtags on your Journals page, you can easily visualize how well you've kept to habits that you set for yourself. Simply add the tags and the habit you want to track to your daily Journal, and use the plugin to see how you're doing.

Logseq Property Visualizer

If you add page properties to the first block of your Journals pages, you can visualize them using the Logseq Property Visualizer plugin. Personally, I use this instead to track habits, as I try to hit specific numbers every day (workouts, minutes of foreign language input, words written, etc.).

Logseq SmartBlocks

If you notice that you often don't use (tagged) blocks in your daily Journals template, consider replacing them with SmartBlocks buttons. Much like Roam SmartBlocks, this plugin lets you create buttons to trigger templates. If you chop up your daily template into smaller templates and add trigger buttons to your main daily template, you can reduce noise by a lot. It'll also prevent having empty but linked blocks lingering on your old Journals pages.

Logseq Full House Templates

If you need to use more complex logic for your Daily Journal templates, you can use the Full House Templates plugin. This plugin allows you to involve the JavaScript environment and any Logseq context information to create a template that suits your needs. For example, you can add a navigation header to switch between days, include a monthly review task (but only on the last day of the month), or enhance your journal with stylish views of what you're currently reading.

You can find an example of how to set up a daily journal template with the Full House Templates plugin here.

Even if you are not familiar with programming, you can still set up ready-made templates from the Showroom.

0:00
/

Ideas on how to make this process better?

Do you see ways to make the daily Journals template even better, or do you know of useful new plugins? Send us a message and help improve this article.