Skip to content

Maintenance guide

Hugo Gruson edited this page Oct 10, 2020 · 3 revisions

covidpreprints maintenance guide

Back-end: auto-generating the documentation from Rmd files

The back end of the website relies on the pkgdown R package. pkgdown primary goal is to provide R package developers with a simple way to produce a good-looking and user-friendly documentation. As such, all content will be generated from items that already exist in packages. In particular:

  • the landing page is auto-generated from the file README.Rmd or README.md and the DESCRIPTION file (to create the content on the right: author names, URL of the repository, license, etc.)
  • the other pages are created by knitting the package vignettes (contained in the vignettes/ folder).

Some settings of pkgdown can be tweaked in the _pgkdown.yml folder. A list of options that you can customise is available on pgkdown's own pkgdown website.

Front-end: hacking the CSS

pkgdown uses bootstrap 3 and bootswatch themes. The bootswatch theme can pick selected in the _pkgdown.yml file, as mentioned earlier.

It is also possible to use custom css or js either:

  • sitewide by adding the code to the files pkgdown/extra.css or pkgdown/extra.js.
  • for a specific page by adding the code withing the Rmarkdown (.Rmd) files or by loading external resources, as explained in the Rmarkdown guide.

You can use bootstrap classes in your custom CSS but you should also be careful about name clashes (e.g., bootstrap already has a container class so we renamed our custom containers for the timeline to container-tl).

Auto-deployment via GitHub actions

The website is auto-deployed via GitHub Actions, and more precisely via the action defined in pkgdown.yaml. This action was modified from the default template provided by usethis::use_github_action("pkgdown"). If something breaks with the auto-deploy, it may be worth checking the changes in the upstream file in case it is a general issue and they added a fix on their side

This action runs (and auto-deploys the website) at two times: