I found such query to display 20 last pages, but the result includes also the tag pages that were dynamically created.
I want to display only “normal” pages and exclude everything that doesn’t physically exist in folder /pages.
What is the best way to achieve it?
- #+BEGIN_QUERY
{:title [:h3 "Recent 20 Pages"]
:query [:find (pull ?b [* {:block/_parent ...}])
:in $ ?end
:where
[?b :block/updated-at ?v]
[(- ?end 30 * 24 * 60 * 60 * 1000 ) ?period]
[(>= ?v ?period)]
[(< ?v ?end)]
]
:inputs [:end-of-today-ms]
:result-transform (fn [result] (take 20
(sort-by (comp - (fn [h]
(get h :block/updated-at))) result)
) )
}
#+END_QUERY