# Roam/Logseq like journal

**URL:** <https://community.silverbullet.md/t/roam-logseq-like-journal/711>\
**Category:** General\
**Created:** [July 24, 2024, 9:25pm UTC](https://community.silverbullet.md/t/roam-logseq-like-journal/711 "2024-07-24T21:25:06Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![anevaiopvn](https://community.silverbullet.md/user_avatar/community.silverbullet.md/anevaiopvn/32/438_2.png) [@anevaiopvn](https://community.silverbullet.md/u/anevaiopvn)\
**Post date:** [July 24, 2024, 9:25pm UTC](https://community.silverbullet.md/t/roam-logseq-like-journal/711/1 "2024-07-24T21:25:06Z")

</div>

Hi. I am not currently able to test Silverbullet yet so a quick question: is it possible to get a Roam/Logseq like infinitely scrollable daily notes view as start page? I use Obsidian currently but that thing from Logseq I really miss.

---

<div class="post-metadata">

**Author:** ![meain](https://community.silverbullet.md/letter_avatar_proxy/v4/letter/m/4da419/32.png) [@meain](https://community.silverbullet.md/u/meain)\
**Post date:** [July 25, 2024, 6:37am UTC](https://community.silverbullet.md/t/roam-logseq-like-journal/711/2 "2024-07-25T06:37:56Z")

</div>

SB does not have scrollable infinite journal like LogSeq. You can set up any page (including today’s journal page) as the start page though.

I personally have added these buttons to the top of my journals via a `templates` so that I can easily navigate between journal pages.

![Screenshot 2024-07-25 at 12.04.49 PM](https://community.silverbullet.md/uploads/default/original/1X/7bb9480be0daf37843505e9f06a03d5844152f93.png)

---

<div class="post-metadata">

**Author:** ![papazol896](https://community.silverbullet.md/user_avatar/community.silverbullet.md/papazol896/32/431_2.png) [@papazol896](https://community.silverbullet.md/u/papazol896)\
**Post date:** [July 25, 2024, 12:40pm UTC](https://community.silverbullet.md/t/roam-logseq-like-journal/711/3 "2024-07-25T12:40:00Z")

</div>

@meain May I ask you to explain how did you create this button?

---

<div class="post-metadata">

**Author:** ![anevaiopvn](https://community.silverbullet.md/user_avatar/community.silverbullet.md/anevaiopvn/32/438_2.png) [@anevaiopvn](https://community.silverbullet.md/u/anevaiopvn)\
**Post date:** [July 25, 2024, 1:21pm UTC](https://community.silverbullet.md/t/roam-logseq-like-journal/711/4 "2024-07-25T13:21:12Z")

</div>

Thank you. Sadly not quite what I would like though.

---

<div class="post-metadata">

**Author:** ![meain](https://community.silverbullet.md/letter_avatar_proxy/v4/letter/m/4da419/32.png) [@meain](https://community.silverbullet.md/u/meain)\
**Post date:** [July 25, 2024, 3:27pm UTC](https://community.silverbullet.md/t/roam-logseq-like-journal/711/5 "2024-07-25T15:27:22Z")

</div>

The top thing is a template. To do that add the following into a page.

```auto
---
description: Add Journal headers
tags: template
hooks.top.where: 'name =~ /Journal\/Day\//'
---
> [[Journal/Day/{{journalPageFromDate(prevDate(basename(@page.name)))}}]] [[Journal/Day/{{journalPageFromDate(nextDate(basename(@page.name)))}}]]
> Year progress: {{yearProgress}} ({{dayOfWeek}})

```

There are a few custom functions here, for those, you have to add [Space Script](https://silverbullet.md/Space%20Script). _You might want to tweak the `journalPageFromDate` function. Mine is in the format `Journal/Day/YYYY/MM/YYYY-MM-DD`._

```auto
function getPreviousDate(dateString) {
    let date = new Date(dateString);
    let previousDate = new Date(date);
    previousDate.setDate(date.getDate() - 1);
    return previousDate.toISOString().split('T')[0];
}

function getNextDate(dateString) {
    let date = new Date(dateString);
    let nextDate = new Date(date);
    nextDate.setDate(date.getDate() + 1);
    return nextDate.toISOString().split('T')[0];
}

silverbullet.registerFunction(
  {name: "prevDate"},
  (curDate) => {
    return getPreviousDate(curDate)
  }
)

silverbullet.registerFunction(
  {name: "nextDate"},
  (curDate) => {
    return getNextDate(curDate)
  }
)

function getBasename(path) {
    // Remove any trailing slashes
    path = path.replace(/\/+$/, '');
    
    // Split the path by slashes and get the last part
    const parts = path.split('/');
    return parts.pop();
}

silverbullet.registerFunction(
  {name: "basename"},
  (pth) => {
    return getBasename(pth)
  }
)

silverbullet.registerFunction(
  {name: "journalPageFromDate"},
  (dt) => {
    const splits = dt.split("-")
    return `${splits[0]}/${splits[1]}/${dt}`
  }
)

```

---

<div class="post-metadata">

**Author:** ![papazol896](https://community.silverbullet.md/user_avatar/community.silverbullet.md/papazol896/32/431_2.png) [@papazol896](https://community.silverbullet.md/u/papazol896)\
**Post date:** [August 1, 2024, 7:15pm UTC](https://community.silverbullet.md/t/roam-logseq-like-journal/711/6 "2024-08-01T19:15:17Z")

</div>

Hi, Thank you for code.  
I added template part to my template collection page.  
Defined as a template.  
I created a SpaceScript page and added the functions on it.  
Both pages are tagged as meta.  
Wat do i need to do feather to get template to work?

---

<div class="post-metadata">

**Author:** ![meain](https://community.silverbullet.md/letter_avatar_proxy/v4/letter/m/4da419/32.png) [@meain](https://community.silverbullet.md/u/meain)\
**Post date:** [August 2, 2024, 3:57am UTC](https://community.silverbullet.md/t/roam-logseq-like-journal/711/7 "2024-08-02T03:57:36Z")

</div>

That should be it. Make sure you run `Reload` via `Ctrl+Alt+r` and just refresh the page for good measure.
