A datapage is a website for your data, showing users interactive visualizations, documentation, and the data itself. And whatever other content you want! See the live example here
This repo contains a quarto extension that provides a custom quarto project type, format, and some handy lua filters, as well as a GitHub action that automatically renders your datapage and publishes it on GitHub pages.
To make a datapage for your dataset, first put your dataset in Redivis (see here for more information on Redivis datasets).
You'll also need to go into your Redivis account settings and create a Redivis API token (see here for more information). Make sure to check the box for "Data" to give the token sufficient scope.
Then make a GitHub repo for your datapage from this template repo. You can click on the "Use this template" button up top to create your repository (and make sure you check "Include all branches" on the next screen).
To link up your repo with Redivis, you need to provide add your Redivis API token as a repository secret. You can go into your repository's Settings > Secrets and variables > Actions and click on "New repository secret" and give it the name REDIVIS_API_TOKEN
.
You also need to ensure that GitHub Actions has permission to write to your repository. Go into your repository's Settings > Actions > General > Workflow permissions and check the box for "Read and write permissions".
Now you can customize your datapage! In the _quarto.yml
file, set your project title and your Redivis table information:
redivis:
user: datapages
dataset: palmerpenguins
table: penguins
In index.qmd
, edit the title, subtitle, description, and images for your homepage. In about.qmd
, edit the images, links, and citation. The other pages update automatically.
For local development, create a file at the root of the repo called .Renviron
with the contents (replacing 12345
accordingly):
REDIVIS_API_TOKEN=12345
Run renv::restore()
to install R package dependencies. Then run quarto preview
to see the site output. Once you push to GitHub, a GitHub action automatically renders the site and deploys it to GitHub pages.