I spent too much time today on tweaking my Obsidian daily note template. Here is the final thing, read below for a chunk-by-chunk explanation.
<% tp.user.motivational() %>
> [!todo]
> - [[Tasks#In the future]]
> - [[Tasks#Anytime]]
> ### ⚠️ Overdue
> <%* if ([0,6].includes(tp.date.now("d"))) { %>
> ```tasks
> due before today
> not done
> ```
> <%* } else { %>
> ```tasks
> due before today
> not done
> tag does not include work
> ```
> <%* } %>
> ### Inbox (Aim for zero!)
> ```tasks
> no due date
> not done
> no tags
> ```
> ### Due Today
> <%* if ([0,6].includes(tp.date.now("d"))) { %>
> ```tasks
> due today
> not done
> ```
> <%* } else { %>
> ```tasks
> due today
> not done
> tag does not include work
> ```
> <%* } %>
<% tp.file.cursor() %>
A fresh daily note page generated from this template looks like this:
Explanation #
Motivational Statement #
A randomly selected motivational statement. This uses the Obsidian Templater user scripts functionality. The script:
1function get_statement() {
2 const motivationalStatements = [
3 "💪 Every day is a new opportunity to shine. ✨",
4 "☀️ Embrace the possibilities that lie ahead. 🚀",
5 "👏 Believe in yourself and your abilities. 🌟",
6 "👍 Your hard work will pay off in the end. 🌱",
7 "😊 Stay positive, even when things get tough. 🌈",
8 "😎 Make today amazing. 🔥",
9 "😇 You are capable of achieving great things. 🏆",
10 "💯 Strive for progress, not perfection. 💫",
11 "🎯 Focus on your goals and don't give up. ⛰️",
12 "💡 Let your creativity guide you. 🎨",
13 "💖 Spread love and kindness wherever you go. 🕊️",
14 "🌱 Grow through what you go through. 🌻",
15 "🚀 Take the first step towards your dreams. 🌠",
16 "🎈 Celebrate every small victory. 🎉",
17 "🧘♀️ Find peace and balance within yourself. 🍀",
18 "😃 Choose happiness today and every day. ☀️",
19 "🤝 Together, we can make a difference. 🌍",
20 "🎼 Fill your day with positive vibes and energy. ⚡",
21 "📖 Write your own story. ✍️",
22 "🌟 You are enough, you are worthy, you are loved. ❤️"
23 ];
24 const randomIndex = Math.floor(Math.random() * motivationalStatements.length);
25 return motivationalStatements[randomIndex];
26};
27
28module.exports = get_statement;
Tasks overview #
This has a couple of backlinks to my Tasks page (which I wrote about before) and expanded lists of the most relevant lists: what is overdue, what is not filed yet (in my inbox), and what is due today. This is rendered as a callout so it stands out and I can collapse it. The [!todo]
statement at the top is a special callout type that will render the callout with a ✓ Todo
title.
There Javascript conditionals ensure that I do not see any work-related tasks on weekends 🤓. This is supported through Templater's Execution Commands.
Cursor position #
Finally I use the Templater plugin's cursor
function to put the input focus below all this.