Show Random Note (incl. keyboard shortcut)

You can almost do what you want using Logseq Advanced Query that you put on any page, say Random Page Query and include this query by Weihua on Logseq Discord Datalog channel. It’ll show a link to a random page each time the block refresh.

#+BEGIN_QUERY
{:title "Give me a random page!!!"
 :query [:find ?name
         :where
         [?b :block/name ?name]]
 :result-transform (fn [result]
                     [(rand-nth result)])
:view (fn [result]
       [:div.flex.flex-col
        (for [page result]
          [:a {:href (str "/#/page/" page)} (clojure.string/capitalize page)])])
 :collapsed? false}
#+END_QUERY
2 Likes