-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make it easier to cite references #830
Comments
@gcushen In the opening issue you mention BibTeX references. BibTeX (as I presume you know) is a data format. If this issue is exclusive to processing using that data format then I apologize as my feedback/discussion takes a more data format agnostic approach to the issue (and I hope that others feel free to improve on my feedback). While discussing Bibliographic citations I am also going to discuss Footnotes as I think these are a very similar use case. We are happy and grateful that Academic supports endnotes on pages (including blog posts) with the The following syntax would have a better flow: I am at a loss on how to get hugo to count the total number of footnotes when it renders the shortcodes. If there were a way to count all the footnotes on a page and then assign each a number at render time this would solve the footnote challenge. I wonder if the page format/template could have a function which would I am curious, though Has anyone experimented with a way to also add citations in a references section on the post? Note that this is different from the publications section of Academic's features. My quick thought is that citations and footnotes could be solved with the same pattern. With citations there are generally two parts to a citation the inline portion I would imagine that a short code could be constructed in the following manner With a short code I can clearly see how to add either of these params in one of the two places. But how does one create a short code which adds content in two places (and alphabetical order in the second place? Tools like citation.js take the data format from BibTeX and convert it to CSL-Json. which can then be styled dynamically with CSL profiles (also take a look at citeproc-js). So, if someone wants to use APA in their posts but someone else wants to use MLA they could (ideally) set a One drawback I can see is that when citation data is maintained in its own file it then needs to be referenced — usually with a key. This means we might have a shortcode with the shape of something like: But if we abstract the json citation data to its own json file and attach that to a page or post as a resource, is that ok? we do this with photos. There is the Hugo data folder but it seems pertinent to keep the citations of a post or page with the post or page, especially when considering portability. Does hugo have the ability to create files on the fly? It seems to me that output-formats can do this. If they can, the contents of footnotes and citations short codes could be appended to one of these output formats (which is itself a partial) as Hugo parses the page at render time, then a reference and footnote section at the end could pull in the content of the dynamically generated partial to the HTML page at the end of the render of each page. Here are a few citations to play around with. I exported these from Zotero as |
This issue is regarding making it easier to cite in general. The "Bibtex" in the title was just an example and no longer relevant so I'll remove it. I began investigating this soon after the issue was created and it was decided that any solution would use the web-friendly JSON reference standard, as you mentioned :) Note that this issue is somewhat related to #1020 on generating Publication pages directly in Hugo, without Academic Admin. |
One of the next decisions that need to make is should a JSON file be exported for each post, or should we have a single large JSON file for the entire site? Each approach has pros and cons which need to be considered. |
Not sure if it is practical for academic but with RMarkdown we specify a
bib file in the header and use something like [@smith_refFirstWord_2019] in
the text. At render time, pandoc is called, with the help of a library
called citeproc, that renders the citations and then converts the document
to a pre-specified format.
…On Fri, 19 Jul 2019, 00:14 George, ***@***.***> wrote:
This issue is regarding making it easier to cite in general. The "Bibtex"
in the title was just an example and no longer relevant so I'll remove it.
I began investigating this soon after the issue was created and it was
decided that any solution would use the web-friendly JSON reference
standard, as you mentioned :)
Note that this issue is somewhat related to #1020
<#1020> on generating
Publication pages directly in Hugo, without Academic Admin.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#830>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAJGGH7R5E2HZD4FIPYNY3DQADMMXANCNFSM4GIDUR6A>
.
|
With @vkehayas solution type the file specified could be either a master (per site) file or a per page file. |
A file of references for each post seems very natural to me. What’s the upside of a master file? There is this notion of a researcher maintaining a master file of useful references but I’ve never found that to work. References are defined by the document citing them so should live with that document. Happy to try something like the citeproc.js solution. |
Hugo are yet to introduce such functionality. However, Wowchemy Version 5 Beta 0 introduced a Cite shortcode which may help address some of these use cases - interested to hear feedback :) First, create a page for the publication that you wish to reference if one doesn't already exist and then cite it using the shortcode:
where The Hugo Academic CLI tool can be used to automatically generate publication pages from Bibtex, which can then be cited. Additionally, footnotes can still be used for citing external references, albeit requires manually pasting in each reference from your ref. manager as a Markdown footnote. |
Closing as no further feedback on the two current approaches for citations in my previous comment and also this issue is now tracked in the Hugo repo at gohugoio/hugo#6101 - feel free to add a 👍🏻 there to upvote. |
I must admit that the single bibtex for each post file would be really cool as this also the approach taken by the jupyter book project. And adding every citation that I would like to have in some blog post to my own citation folder does not seem super simple either. Would be awesome if the cite short-cut could be extended to work with bibtex... |
@fretchen You might be interested in this hugo module. It uses CSL JSON but is really powerful https://github.com/loup-brun/hugo-cite |
@HughP this worked out quite nicely. Thanks a lo. For reference of other users, here were the steps that I had take to make it work:
|
Currently, footnotes can be used for citing references, but this requires manually pasting in each reference from your ref. manager as a footnote.
Therefore, let's consider adding a more automated referencing approach that can read refs direct from a file.
Investigation into Hugo's Mmark citation system:
<div>
and Hugo generates an empty citation tag and shows the ref fields as unformatted verbatim at end of page. Also, see similar result experience by another user: https://discourse.gohugo.io/t/citations-using-mmark/16723Solution
references.json
within a post's folderDecisions
references.json
within a post's folder as the inputThe text was updated successfully, but these errors were encountered: