Citations
Arguably the most important feature of this template is its ability to automatically generate citations from simple identifiers. This makes it easy to cite and maintain large lists of publications.
The template is able to do this thanks to Manubot, a suite of tools that (among many other things) lets you automatically generate a citation with full details from just a short identifier, like doi
, url
, isbn
, pmc
, pmcid
, pubmed
, arxiv
, and many many more.
How it works
First let's define some consistent terminology to make things easier to explain:
source - A paper, book, article, web page, film, or any other published item you want to cite.
metasource - A single item that lists multiple sources, like how an author's ORCID number can be used to get a list of their published works.
citation - Full, detailed information about a source, like title, author(s), publisher, publish date, URL, etc.
For most content on your site, you just need change the contents of the appropriate file. Citations have a special additional step. When you add new sources or metasources to be cited, the template has to run a special "cite process" to generate your full citations.
At a high level, here's how it all works:
Input your sources and metasources in
/_data
files, e.g.sources-2020.yaml
,orcid-students.yaml
, etc.The cite process outputs a single
citations.yaml
file in/_data
.
Do not edit citations.yaml
! It will get overwritten each time the cite process runs. If you need to manually input or correct things, see below.
You can mix and match as many sources and metasources as you want, and display them however and wherever you'd like! For example, you may want to have a "CV" page that lists all of the papers under your PI's ORCID, then reserve your "Research" page for just a few special papers by various members in your lab that you want to highlight.
Examples
Basic id
Filename must start with sources
.
Rich details
Optionally, you can manually pass extra "rich" details that the template can display nicely. Manubot can't automatically determine these.
Always provide a good thumbnail for your publications. Use a figure from the source, or if there are none, a journal logo or issue cover. Here are some best practices for making a good thumbnail image.
Manual override
All fields you attach to a source (or metasource, see below) get passed through to the generated citation untouched. This allows you to manually input or correct details of a citation.
If you don't provide an id
, Manubot has nothing to cite and so doesn't run. You'd only want to do this if manually providing all the citation details manually. This defeats the main benefit of the template, but is sometimes necessary.
You can also attach arbitrary fields. The template won't explicitly use them, but you could use them to filter citations with the list component.
ORCID
ORCID is the recommended way to retrieve a complete set of published works for an author.
Filename must start with orcid
.
Each ORCID gets expanded into a full list of regular sources with id
s. Any fields you put in the original entry get copied to each source in the expanded list. This applies to the other types of metasources below as well.
To conveniently and explicitly associate an ORCID with a person for filtering with the list component, you can add a unique field for that person like in the example above and use a filter like this:
Because the cite process merges duplicate sources by id
, you can also use the manual override method above to manually correct sources returned from metasources. You can also use the special remove
field to ignore a source returned from a metasource, discarding it from the citations output. Example:
If a metasource returns a source with a type of identifier that Manubot doesn't know how to cite, that source will be ignored. When this happens, the cite process prints a warning, not a critical error, so you'll have to check your CLI output or GitHub Actions logs.
PubMed
See ORCID above for general metasource functionality.
Uses NCBI eutils to search PubMed for terms. This is a brittle way to select an author's papers, very vulnerable to false positives. ORCID is recommended.
Filename must start with pubmed
.
Google Scholar
See ORCID above for general metasource functionality.
Unfortunately, Google does not provide APIs for many of its services, and that includes Scholar. Luckily there is a 3rd-party API to access it, SerpAPI. First you'll have to sign up and get an API key. Then, if running the cite process on GitHub, make a new repository secret named GOOGLE_SCHOLAR_API_KEY
with your API key as its value, or if running locally, put the same name/value in a .env
file.
Filename must start with google-scholar
.
Periodic updates
Metasources like ORCID update over time as you publish new sources. To accommodate this, the template tries to automatically re-run the cite process periodically. In your repo's "▶️ Actions", see the "on schedule" workflow.
GitHub imposes certain limitations on scheduled workflows. You may have to manually enable the workflow, or re-enable it after a while.
When the workflow runs, it will get the latest sources associated with your metasources, generate citations like normal, and open a pull request to let you review the changes before publishing them.
Due to another GitHub limitation, if you want to see a live preview link for this pull request, you'll have to close (not merge) and reopen it. That should trigger the "build preview" workflow.
Cache
If you have many sources, generating the citations for all of them can take a while. To save time, the cite process keeps a time-to-live cache for Manubot/ORCID/etc. network requests. If a cached response hasn't expired, it is used instead of making a new request. To clear this, simply delete the cache file in _cite
. You can also customize the default expire times in the Python code in _cite
.
Last updated