render first-level and immediate parent heading in link's source-title

main
Ryan Rix 2022-08-05 14:21:52 -07:00
parent 482f383a4e
commit 962911ce5a
2 changed files with 10 additions and 10 deletions

View File

@ -639,14 +639,14 @@ Links in the [[id:cce/org-roam][org-roam]] database have a useful =type= column.
[:select file :from nodes
:where (= id $s1)]
dest)))
(source-title (caar (org-roam-db-query
[:select title :from nodes
:where (= id $s1)]
source))))
(immediate-source-title (caar (org-roam-db-query
[:select title :from nodes
:where (= id $s1)]
source))))
(when (and dest-file (arcology--published-page? dest-file)
(arroyo-db-query [:insert :into arcology-links
:values $v1]
(vector source-title file source dest-file dest))))))
(vector (concat source-title " -> " immediate-source-title) file source dest-file dest))))))
;; insert https link?
((equal type "https") nil)
((equal type "http") nil)

View File

@ -59,14 +59,14 @@
[:select file :from nodes
:where (= id $s1)]
dest)))
(source-title (caar (org-roam-db-query
[:select title :from nodes
:where (= id $s1)]
source))))
(immediate-source-title (caar (org-roam-db-query
[:select title :from nodes
:where (= id $s1)]
source))))
(when (and dest-file (arcology--published-page? dest-file)
(arroyo-db-query [:insert :into arcology-links
:values $v1]
(vector source-title file source dest-file dest))))))
(vector (concat source-title " -> " immediate-source-title) file source dest-file dest))))))
;; insert https link?
((equal type "https") nil)
((equal type "http") nil)