r-lib / hugodown

Make websites with hugo and RMarkdown
https://hugodown.r-lib.org
Other
166 stars 24 forks source link

Adding more docs for citations? #28

Open maelle opened 4 years ago

maelle commented 4 years ago

Might be too niche. I was thinking that some users might want to use a site-wide CSL, and even a site-wide bibliography (it was asked in the issue tracker of distill).

It's easy to get and I wonder whether it should be documented, maybe in an article about bibliographies.

bibliography: ../../../refs.bib
suppress-bibliography: true
csl: ../../../chicago-fullnote-bibliography.csl

I've just tested it.

hadley commented 4 years ago

I’m also going to add a hugodown specific config file where those defaults can be recorded.

maelle commented 4 years ago

Ah cool! why does it have to be separate from the Hugo config file?* Couldn't the settings live in it? Wondering because I find bookdown's two config files puzzling (I never remember which is which).

hadley commented 4 years ago

Because I'd estimate it's at least a day's work to write code that reliably finds all hugo config file given that it can be in three different formats and spread across multiple directories. (I agree with you about the bookdown problem, but I think that's fundamentally different in nature)

maelle commented 4 years ago

right. will you call it _site.yml? :-)

Edit: I take it back. The specific name is better for GitHub code search 😁

hadley commented 4 years ago

Note to self: for this case, I think we'd need a preprocess hook that adds the bibliography, suppress-bibliograph and csl to the yaml front matter if they don't exist in the yaml front matter. csl should probably default to a file included in hugodown itself, since we can likely pick a reasonable default.

maelle commented 4 years ago

Just wanted to note I got this question. :slightly_smiling_face: So in the future the plan would be for such defaults to live in hugodown.yaml? A default CSL sounds awesome.