New to silverbullet, help with Journal template and tasks query

Hello, not long started with silverbullet – excited by the potential, but finding quite a steep learning curve for some aspects.

There’s a couple of things could do with a leg up on, to help me on the way:

  1. I want to be able to build a daily journal template.

a. Accessible with a shortcut key, and uses a naming convention like Journal/{today} where today uses the ISO format yyyy-mm-dd

b. At the top is a query for all incomplete tasks with a deadline that has passed or is due today, ideally sorted by this deadline.

The following query seems like a good starting point, just missing the where clauses for incomplete and the deadline, along the the sort by.

${template.each(query[[from index.tag "task" where page == _CTX.currentPage.name]], templates.taskItem)}

I’m not sure how deadlines or due dates are implemented or if they are at all?

c. If possible to able to open journal entries for future dates – .e.g. for planning.

  1. And finally, ideally I’d like to work out a way of excluding personal tasks from work tasks. My thoughts on this would be to perhaps exclude based on a tag on the task, or exclude tasks on a certain page?

Thanks very much.

Previously there was a attribute extractor in v1, which can translate emoji like structure into deadline something: Migrating from Obsidian-Tasks

Yet this is not working on v2 as the feature attribute extraction has been removed. But the underlying mechanism still works: you can add metadata directly to any of the objects in the SilverBullet.

- [ ] some task [deadline: 2025-05-06]

Then you can query deadline with

${
query[[
from index.tag "task"
where deadline == "2025-05-06"
]]
}
1 Like

Answer to other questions:

  1. you can, just follow the doc Library/Std/Page Templates. It is basically a normal page with specific tag and frontmatter. Below is my template for weekly note for your reference. Note you need to implement the specific helper function yourselfs.
---
command: "Journal: Open Weekly Note"
suggestedName: "Journal/Week/${os.date('%Y')}-W${date.currentWeeknum()}"
key: "Alt-w"
confirmName: false
tags: meta/template/page
priority: 9
openIfExists: true
frontmatter: "weekStart: ${date.startOfWeek()}\nweekEnd: ${date.endOfWeek()}"
---

## Motivation 

|^|

## Goals 

## Changlog 
  1. Yes, you can definitely do this.
1 Like

That’s a great start thank you, I’ve created my own template query that gives link to page task name and deadline, and filters on deadline and done status which gives:

image

Is there a function I could replace where deadline <= "2025-05-05" with so it automatically gives today’s date? I’ve tried replacing “2025-05-05” with ${date.today()} but that doesn’t work within the Where clause.

Will have a bash at the page template next. Thanks again.

The date api documentation/implementation is here: Library/Std/Date. It is actually based on the os api you can find here: API . Note that the API page is not totally up-to-date since it was a one-time generation from Zef using AI helper. But the api documented there should be working right now.

For your case, what you need in the Lua Integrated Query is like

${
query[[
  from t = index.tag "task"
  where t.deadline <= os.date('%Y-%m-%d')
]]
}

Or with date module

${
query[[
  from t = index.tag "task"
  where t.deadline <= date.today()
]]
}

Inside the QIL you don’t need the ${} block

1 Like

That’s great thank you — much appreciated