loup-brun / hugo-cite

📝 Easily manage your bibliography and in-text citations with Hugo, the popular static-site generator.
https://labs.loupbrun.ca/hugo-cite/
Do What The F*ck You Want To Public License
110 stars 28 forks source link

literal value in CLS-JSON #26

Open HughP opened 4 years ago

HughP commented 4 years ago

When citing a publication with a corporate author CSL adds a "literal" value to the author field. Hugo-Cite goes blank here. The solution is to make the authorPart more robust so that it deals with these situations.


  {"id":"international_organization_for_standardization_iso_iso_2007","author":[{"literal":"International Organization for Standardization (ISO)"}],"collection-title":"as amended through 2020 by the ISO 639-3 registrar, SIL International","event-place":"Geneva, Switzerland","issued":{"date-parts":[[2007]]},"language":"en","publisher":"International Standards Organization","publisher-place":"Geneva, Switzerland","title":"ISO 639-3:2007 : Codes for the representation of names of languages -- Part 3: Alpha-3 code for comprehensive coverage of languages","type":"book","URL":"https://www.iso.org/standard/39534.html"}
HughP commented 3 years ago

There is an interesting fix to this in the network here: https://github.com/joksas/hugo-cite/commit/1b3cfdb4f331a32ef95ccc7684b6ef103aa4ed6b I haven't tested this mod yet. My initial thoughts when reading the code is that it won't work in all cases. But the code does have some merit. For example. Many names in Asian scripts are coded as literals in CSL-JSON. So we can't be sure that the name refers to a Schema.org/Person. The other case for literals is that it is a corporate name which would get a Schema.org/Organization encoding. I don't see how we can code for 100% accuracy for both of these use cases. The second thing I see (or don't) is ho the current code (in the indicated fork) handels cases of two or more corporate authors.

partigabor commented 1 year ago

I would also like to second this and "request" an extension regarding the 'author' field, so hugo-cite can accept literal author/editor (corporate authors), with no family name or given name. I would assume that whoever is fluent writing hugo shortcodes could do this in a few minutes so the partial could read this field from the JSON as well.

Amazing tool by the way, thanks a lot!