Ok, this is the easiest so far but it is assuming you don’t have a default home page set in config.edn
so the first thing Logseq does upon starting up is loading the Journals Page (the continously scrollable list of Journals you get when you do G J
).
// If we are in Go-To-Journals then grab the Link of the first Journal displayed (presumably Today's
const todaysJournalLink = document.querySelector('.initial-color.title.journal-title');
if (todaysJournalLink && todaysJournalLink.getBoundingClientRect().top <= 0) {
todaysJournalLink.click();
const todaysJournalPage = todaysJournalLink.querySelector('h1.title').textContent;
logseq.api.set_current_graph_configs({"default-home": {"page": todaysJournalPage}})
}
This code is run when custom.js
is loaded, runs one time and grabs the link and text of the first Journal’s Title and simulates a Click on it which brings you to the Current Day’s Journal. It also sets the default-home
from within Logseq (internally), as per the suggestion here so that if you end up in some Page in some Block G H
will bring you Home.