The contextual sidebar: query current page and organize pages in indexes

This is great. A tip for anyone using the vanilla version of Logseq without related plugins:

(1) You can pin/anchor Current page item at the top of right sidebar by adding to custom.css:

#right-sidebar-container .sidebar-item-list > .sidebar-item:has(a[href$='current%20page']) {
  order: -1;
}
  • Replace current%20page by the actual name of your Sidebar queries page.
  • This page name is lower case and needs to be URL-encoded. E.g. spaces get replaced by %20.
  • Latest Logseq version is required due to :has selector.

(2) Open sidebar queries as default on each startup by putting into config.edn:

:default-home {:sidebar ["Current page"]}
  • Replace Current page by the actual name of your Sidebar queries page.
4 Likes