Is it possible, with Macros, to run a db query for a block-id an build the {{embed ((block-id))}} inside a page?

Seems that, by:

  • leaving an empty line
  • escaping double quotes

…it is already possible to:

  • define an advanced query in a macro:
    :macroname
    "
    #+BEGIN_QUERY
    {
      :title \"$1\"
      :query [:find (pull ?p [*])
        :where [?p :block/name \"$2\"]
      ]
    }
    #+END_QUERY
    "
    
  • use it with parameters: {{macroname title, pagename}}
5 Likes