Zenodo
Before storing our repository in Zenodo, we will add some metadata to it, so our material is easily identifiable in Zenodo. We do this by adding a file called .zenodo.json
to our repository, a json file specifying the different metadata attributes for zenodo. Here’s an example of such a file:
{
"title": "Analysis of babynames",
"upload_type": "publication",
"publication_type": "report",
"keywords": [
"R",
"quarto",
"tutorial"
],
"creators": [
{
"name": "Geert van Geest",
"affiliation": "SIB Swiss Institute of Bioinformatics",
"orcid": "0000-0002-1561-078X"
}
]
}
Add a .zenodo.json
file to your repository, and change it accordingly (e.g. at least change the creator name and ORCiD). Consider adding attributes specified here. After that, add it to the repository, commit the change and push it to the remote.
Modify the .zenodo.json
file and add it to the repo. Stage, commit and push like so:
git add .zenodo.json
git commit -m "adds .zenodo.json file"
git push
Now that we have added metadata to the repository, we can link our repository to Zenodo:
Browse to zenodo.org and sign up by using your GitHub account.
On the top right, click the drop-down menu and select GitHub.
All the public repositories in your namespace are in the list. Move the switch at the repository you have just created.
Now, go to your repository on GitHub and create a release. Do this by selecting Create a new release on the right side.
Choose a tag that starts with
v
and follows the rules of semantic versioning, so a good first name would be e.g.v1.0.0
.Choose a release title. This can be anything.
Click the green button Publish release
Go back to the GitHub page on Zenodo and click Sync now at the top right.
There should now be a green bar at your repository, and it received a DOI. You can check out the record by clicking on the repository name
Off course we want to show off with the DOI we just assigned. In order to do that:
Click the DOI badge. A window will appear with code chunks that you can use to display the badge.
Copy-paste the markdown syntax to your main page (
index.qmd
) to show it on your website.Stage, commit and push the change. After that, render and publish the website.
An example of the top of index.qmd
:
---
title: "quarto-tutorial"
---
[![DOI](https://zenodo.org/badge/657627364.svg)](https://zenodo.org/badge/latestdoi/657627364)
After that, we run the commands:
git add index.qmd
git commit -m "Adds a badge to the website"
git push
And the quarto commands (not required if you’ve set up the action!):
quarto render
quarto publish gh-pages