Add backlinks when exporting to html
This commit is contained in:
parent
87d8d177db
commit
94862c1514
@ -2107,6 +2107,26 @@ Nice Functions:
|
||||
)
|
||||
#+end_src
|
||||
|
||||
#+begin_src emacs-lisp
|
||||
(defun my/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--get-title-or-slug (car it))))
|
||||
"" (org-roam-db-query [:select [from] :from links :where (= to $s1)] file))
|
||||
""))
|
||||
|
||||
(defun my/org-export-preprocessor (backend)
|
||||
(let ((links (my/org-roam--backlinks-list (buffer-file-name))))
|
||||
(unless (string= links "")
|
||||
(save-excursion
|
||||
(goto-char (point-max))
|
||||
(insert (concat "\n* Backlinks\n") links)))))
|
||||
|
||||
(add-hook 'org-export-before-processing-hook 'my/org-export-preprocessor)
|
||||
#+end_src
|
||||
|
||||
** Helm-Bibtex ([[https://github.com/tmalsburg/helm-bibtex][link]])
|
||||
#+begin_src emacs-lisp
|
||||
(use-package! helm-bibtex
|
||||
|
Loading…
Reference in New Issue
Block a user