We can argue over “weird code”
But essentially the first part is just getting the actual data. We have a page, then we have a block that references that page, and finally we have a page that the block is on. We return the name of that last page in :find ?tag.
The :result-transform sorts the result, feel free to omit I guess.
And the :view determines how it is displayed.
You can change that view in any number of ways to change how the result is viewed.
Without the :view you get the raw data, basically one long string without spaces.
I was experimenting a little and you technically don’t need all aspects of the view. (fn [tags] ...) is just defining a function with input labeled tags. (for [tag (flatten tags)] ...) is basically flatten tags to a string and then for each of the items in tags. [:a ...] is where the link is made with the type .tag.mr-1 actually ensure you have spaces between the tags. (str ...) is a concert to string and also concatenate. Add #/page/ to the result, for the link url part and add # to the result for the link text part.
It’s just what you deem weird. The view transforms raw data into something readable.
If you want a simple vertical list you can try this query instead.