ugo
March 10, 2025, 6:10pm
1
Jekyll (competitor) supports citations via Ruby gems
A Citation Style Language (CSL) Cite Processor
Using the above gem, a theme like just-the-docs allows referencing to the literature, and the list of cited references appears at the bottom of the page, releasing the author from the grunt work.
What is Hugo’s equivalent?
irkode
March 10, 2025, 6:49pm
2
no buil in citation support. you could go with:
footnotes
shortcode
(blockquote render hook)
if you don’t need math support a passthru render hook may be an option.
there’s also a custom module dunno if it’s still alive.
just search for ‘citation’ - quite some topics with some approaches to do it
This has come up before, both in the context of Markdown and AsciiDoc content formats.
I am not recommending an approach, but I am curious about your needs.
Are your citation data files in BibTex or CSL format?
Do you have individual data files, or one data file with multiple citation records?
Which of the citation reference styles do you use:
ugo
March 11, 2025, 8:44am
4
I use BibTex data files with custom citation style.
jekyll extensions for the blogging scholar
In markdown, citing is as easy as writing
{% cite [KEY] %}
At the end of the document, the following line takes care of writing the cited references in full:
{% bibliography --cited %}
Options so far
Review
Jekyll-scholar is kind enough to use the bibtex file, without conversions, and allows for numeric citations;
Hugo-cite comes with APA style only (no numeric citations);
Hugo-simple-cite comes with numeric citations;
Hugo-academic-cli is an out-of-date fork of academic-file-converter
Academic-file-converter just puts a whole data file into markdown: no selective citations and related reference list.
This reduces one’s options to hugo-simple-cite.
Review of hugo-simple-cite
It demands conversion from bib to json;
It does not use the data folder. This causes labour, as it expects a bib.json file in each content folder, namely the same file copied multiple times;
it is fragile: two md files on same folder, using the same citation, citation works on the index file, fails on the other with a shortcode error;
accepted IEEE entries: book, chapter, broadcast, article-journal, article, paper-conference, webpage.
irkode
March 11, 2025, 6:11pm
5
just had pandoc reconed… no clue if it supports your nees or integrates with the rest markdown
ugo
March 13, 2025, 9:16am
8
This is another option:
AsciiDoc with bibtex support:
asciidoctor-bibtex depends on bibtex-ruby, citeproc-ruby and csl-styles:
Add bibtex citation support for asciidoc documents
ugo
March 14, 2025, 11:50am
11
Many options without actual solution.
We need a goldmark extension “citation”, similar to footnote:
Possible usage:
This is a Markdown example with footnotes [^1] [^2] and citations [@3] [@4].
[^1]: This is the first footnote.
This is the second line of the first footnote.
[^2]: This is the second footnote.
### References
@misc{3,
author = {Hugo and friends},
title = {Hugo release version 0.145.0},
year = {2024},
publisher = {GitHub},
url = {https://github.com/gohugoio/hugo/releases},
}
@book{4,
author = {Atishay Jain},
title = {Hugo in action: Static sites and dynamic Jamstack apps},
publisher = {Manning},
year = {2022},
}
This would be a minimal solution, where standard bibtex references are treated like footnotes. It would be far from a solution like Jekyll scholar, but still a minimal solution. The complete absence of a solution is not nice. Using Pandoc brakes themes, so it needs to be a goldmark estension with hugo shortcodes.
This is a Goldmark extension for bibtex:
Goldmark extension for Bibtex citations
Uses the bibtex file directly; no need for conversions.
Lacks the Hugo shortcodes.
Is it possible to add the goldmark extension goldmark-bibtex to Hugo without recompiling hugo?
ugo
March 14, 2025, 5:42pm
12
master
← shoeffner:citeproc
opened 08:07AM - 30 May 22 UTC
Adds the citeproc filter to the pandoc converter.
There are several PRs for i… t this feature already. However, I think
simply adding `--citeproc` is the cleanest way to enable this feature,
with the option to flesh it out later, e.g., in #7529.
Some PRs and issues attempt adding more config options to Hugo which
indirectly configure pandoc, but I think simply configuring Pandoc via
Pandoc itself is simpler, as it is already possible with two YAML
blocks -- one for Hugo, and one for Pandoc:
---
title: This is the Hugo YAML block
---
---
bibliography: assets/pandoc-yaml-block-bibliography.bib
...
Document content with @citation!
There are other useful options, e.g., #4800 attempts to use `nocite`,
which works out of the box with this PR:
---
title: This is the Hugo YAML block
---
---
bibliography: assets/pandoc-yaml-block-bibliography.bib
nocite: |
@*
...
Document content with no citations but a full bibliography:
## Bibliography
Other useful options are `csl: ...` and `link-citations: true`, which
set the path to a custom CSL file and create HTML links between the
references and the bibliography.
The following issues and PRs are related:
- Add support for parsing citations and Jupyter notebooks via Pandoc and/or Goldmark extension #6101
Bundles multiple requests, this PR tackles citation parsing.
- WIP: Bibliography with Pandoc #4800
Passes the frontmatter to Pandoc and still uses
`--filter pandoc-citeproc` instead of `--citeproc`.
- Allow configuring Pandoc #7529
That PR is much more extensive and might eventually supersede this PR,
but I think --bibliography and --citeproc should be independent
options (--bibliography should be optional and citeproc can always be
specified).
- Pandoc - allow citeproc extension to be invoked, with bibliography. #8610
Similar to #7529, #8610 adds a new config option to Hugo.
I think passing --citeproc and letting the users decide on the
metadata they want to pass to pandoc is better, albeit uglier.
Note:
This PR also adds a tiny little bit of unrelated documentation to the external helpers by pointing out MathJax superficially. This certainly needs improvements, but is out of the scope for this PR.
Not part of hugo 0.145.0. Will it be in version 0.146.0?