Switch named block links to autolink to header blocks

Replaced block property approach as it doesn't provide as much
functionality initially
This commit is contained in:
Gabriel Horner
2022-12-15 10:54:25 -05:00
committed by Gabriel Horner
parent 78345ac473
commit 10d6bc28da
7 changed files with 60 additions and 22 deletions

View File

@@ -51,10 +51,10 @@
;; Only query if in a block context
(let [block (when (uuid? page-name-or-block-uuid)
(model/get-block-by-uuid page-name-or-block-uuid))]
(if-let [route-name (get-in block [:block/properties :logseq.block/route-name])]
(if (get-in block [:block/properties :heading])
{:to :page-block
:path-params {:name (get-in block [:block/page :block/name])
:block-route-name route-name}}
:block-route-name (model/heading-content->route-name (:block/content block))}}
{:to :page
:path-params {:name (str page-name-or-block-uuid)}})))