Hello folks. I am new to logseq (started this week), and I’m very excited about it. I have a question to which I couldn’t find an answer otherwise: I’m trying to make a reading list which organizes the things I’ve already read and my notes about it, as well as showing me what I haven’t read yet. I’m using block properties to attach the read status (true
or false
), tags and other info.
I started by using the queries {{query (property read true)}}
and {{query (property read false)}}
to create these views in a separate page, but the query result items are too large (i.e. have too much information), and since I know some Clojure I decided to try making a custom query with a :view
option. All I wanted was a link to the logseq page and a link to the actual article (if any), but I can’t seem to be able to link to the pages (using a link to /page/<page-name>
like I’ve seen in some examples on the internet). At first, I thought it might have something to do with the fact that some of them have whitespaces in the title, but even pages without whitespace fail, and when I click what supposedly would take me to the page I get a dialog asking if I wish to reload Logseq. What am I missing?
Here is the query I used:
#+BEGIN_QUERY
{:title "Unread items"
:query [:find (pull ?p [*])
:where [?p :block/properties ?prop]
[(get ?prop :read) ?read]
[(= false ?read)]]
:view
(fn [results]
[:div
(for [{:block/keys [name original-name properties]} results]
[:div.color-level.px-7.py-2.my-2
[:h4
[:a {:href (str "/page/" name)}
original-name]]
[:a.external-link {:href (:link properties)
:target "_blank"}
"Link"]])])}
#+END_QUERY