After updating to 1.2.3 I noticed that my backlinks weren’t publishing during org-publish, using the org-roam--backlinks-list
example function that was in the org-roam docs back in the day (which no longer seems to be there.)
Couple of updates required:
- function
org-roam--get-title-or-slug
has been deprecated (https://github.com/org-roam/org-roam/commit/face683e00c2fe6c45f6958f05bef1750e7372df).org-roam-db--get-title
looks like the new way to do this. - the backlinks query was using
from
andto
which are nowsource
anddesc
(https://github.com/org-roam/org-roam/pull/1213/commits/399c94b121a124a42493d713fd955cef58767100)
So the tweaked function I’m using now is:
(defun commonplace/org-roam--backlinks-list (file)
(if (org-roam--org-roam-file-p file)
(--reduce-from
(concat acc (format "- [[file:%s][%s]]\n"
(file-relative-name (car it) org-roam-directory)
(org-roam-db--get-title (car it))))
"" (org-roam-db-query [:select [source] :from links :where (= dest $s1)] file))
""))
I noticed here that @jethro has a slightly different function for this, so the general use of elisp there is probably better.