org-ref citations can be exported to Hugo-compatible markdown/HTML by
calling (org-ref-process-buffer 'html)
in the
org-export-before-parsing-hook
hook.
Here’s an example of how to do that using use-package
:
(use-package org-ref
:ensure t
:init
(with-eval-after-load 'ox
(defun my/org-ref-process-buffer--html (backend)
"Preprocess `org-ref' citations to HTML format.
Do this only if the export backend is `html' or a derivative of
that."
;; `ox-hugo' is derived indirectly from `ox-html'.
;; ox-hugo <- ox-blackfriday <- ox-md <- ox-html
(when (org-export-derived-backend-p backend 'html)
(org-ref-process-buffer 'html)))
(add-to-list 'org-export-before-parsing-hook #'my/org-ref-process-buffer--html)))
Example #
Minimal example with org-ref
citations:
#+title: Citation using ~org-ref~
#+hugo_base_dir: ../
[[cite:&SomeCitation]]
Below, the "References" heading will be auto-inserted.
[[bibliography:/path/to/file.bib]]