I have been searching for hours to find how to build a simple query that returns the pages where the frontmatter includes custom tags like
“type:: essay”
“status:: draft”
Every variation of a simple one line query only returned blocks. Eventually, I found this example:
#+BEGIN_QUERY
{:title "All pages have a *programming* tag"
:query [:find ?name
:in $ ?tag
:where
[?t :block/name ?tag]
[?p :block/tags ?t]
[?p :block/name ?name]]
:inputs ["programming"]
:view (fn [result]
[:div.flex.flex-col
(for [page result]
[:a {:href (str "#/page/" page)} (clojure.string/capitalize page)])])}
#+END_QUERY
Can someone please help me understand why I can’t just use something like:
query{{ page type essay }}
And have it return a table of where the columns are “Title (of page)” and “status”?
The learning curve on this seems surprisingly steep and all of the examples suffer from nested explanations. (That is, the examples seem to read like “Tag the tag with “tag” and the tag tags to the tag”.)