Asciidoctor-Bibtex can't find .bib file?

I’m experimenting with hugo using the hugo-book theme (although the theme is not the issue, since the same problem occurs with other themes too). Some of my files are in asciidoc format. Just using plain asciidoc works fine like I would expect, but when I try to incorporate asciidoctor-bibtex, for some reason it can’t find the .bib file ?

failed to execute binary “asciidoctor” with args [-r asciidoctor-bibtex --no-header-footer -]: asciidoctor: FAILED: : Failed to load AsciiDoc document - File ‘references.bib’ is not found (RuntimeError) Use --trace to show backtrace

but the references.bib file is located in the same directory as the .adoc file that is referring to it? This is probably something simple, but I’m still getting my head around how hugo works. Thanks for any tips.

Do this in your site config:

[markup.asciidocExt]
  extensions = ['asciidoctor-bibtex']
  workingFolderCurrent = true

See https://gohugo.io/configuration/markup/#workingfoldercurrent.

That will allow you to use this structure, where the .bib file is adjacent to the .adoc file.

content/
├── examples/
│   ├── example-1/
│   │   ├── index.adoc
│   │   └── references-1.bib
│   ├── example-2.adoc
│   └── references-2.bib
└── _index.md

You might also want to do this:

[[module.mounts]]
source = 'content'
target = 'content'
excludeFiles = '**.bib' # do not publish .bib files when building the site

See https://discourse.gohugo.io/t/using-bibtex-files-with-asciidoc-content/56119.