Skip to content

Latest commit

 

History

History
44 lines (30 loc) · 3.42 KB

README.md

File metadata and controls

44 lines (30 loc) · 3.42 KB

datapage

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

Screenshot 2024-05-10 at 16 32 28

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.

Getting started

To make a datapage for your dataset, first put your dataset in Redivis (see here for more information on Redivis datasets). 0_redivis_dataset

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. 1_redivis_token

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). 1_template_repo 2_create_repo

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. 4_add_secret 5_new_secret

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.

Local developement

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.