How to Use Citation in Persona
Persona supports [@cite] through a Pandoc preprocessing pipeline. This post is the working example for authoring and building citation-enabled content (Zola themes).
Prerequisites
Install Pandoc and watchexec:
# macOS
brew install pandoc watchexec
# Ubuntu / Debian
sudo apt install pandoc
cargo install watchexec-cliFile structure
Keep these files in the same folder:
index.src.md(authoring source)references.bib(BibTeX database)index.md(generated output, do not edit manually)
Write citations in .src.md
Use Pandoc citation syntax in Markdown:
Climate change is accelerating[@ipcc2021].
Multiple studies confirm this[@ipcc2021; @nasa2023].Set optional citation config in frontmatter under [extra]:
citation_style = "apa"bibliography = "references.bib"
Build and serve
Generate
*.mdfrom all*.src.mdfiles:bash scripts/build.shLive rebuild + local server:
# In one terminal, watch for changes and rebuild: bash scripts/watch.sh# In a separate terminal, serve with Zola: zola serve
Citation style resolution order
Priority from highest to lowest:
- Post frontmatter:
[extra] citation_style = "..." - Site-level
config.toml[extra.persona].citation_style - Theme config
themes/persona/config.toml[extra.persona].citation_style
Bundled styles in citation-style/: ieee, apa. Custom styles can be added by placing .csl files in citation-style/ and referencing them in frontmatter.
Output and styling
The pipeline emits HTML citations and bibliography blocks so SCSS can style stable classes:
.citation.references.csl-entry.csl-left-margin.csl-right-inline
Inline citations anchor to bibliography entries, and the bibliography heading is rendered inside the refs container as “Bibliography”.