PMAP 8441 • Spring 2023
Andrew Heiss • Andrew Young School of
Policy Studies • Georgia State University
Quarto + {targets} + {renv} = magic! 🪄
- Install RStudio version 2022.07.1 or later since it has a Quarto installation embedded in it. Otherwise, download and install Quarto separately.
- Open
compasp23.Rproj
to open an RStudio Project. - If it’s not installed already, R should try to install the {renv}
package when you open the RStudio
Project for the first time. If you don’t see a message about package
installation, install it yourself by running
install.packages("renv")
in the R console. - Run
renv::restore()
in the R console to install all the required packages for this project. - Run
targets::tar_make()
in the R console to build everything. - 🎉 All done! 🎉 The complete website will be in a folder named
_site/
.
I use the {targets} package to
build this site and all its supporting files. The complete pipeline is
defined in _targets.R
and can be run in the R console
with:
targets::tar_make()
The pipeline does several major tasks:
-
Build Quarto website: This project is a Quarto website, which compiles and stitches together all the
.qmd
files in this project based on the settings in_quarto.yml
. See the Quarto website documentation for more details. -
Upload resulting
_site/
folder to my remote server: Quarto places the compiled website in a folder named/_site/
. The pipeline usesrsync
to upload this folder to my personal remote server. This target will only run if theUPLOAD_WEBSITES
environment variable is set toTRUE
, and it will only work if you have an SSH key set up on my personal server, which only I do.
The complete pipeline looks like this:
(This uses mermaid.js
syntax and should display as a
graph on GitHub. You can also view it by pasting the code into
https://mermaid.live.)
graph LR
subgraph Graph
x9c20b8c56debbe9a(["deploy_script"]):::skipped --> x78f3e0b711425f1c(["deploy_site"]):::queued
x7aa56383a054e8ba(["site"]):::queued --> x78f3e0b711425f1c(["deploy_site"]):::queued
x4d31f5a49d5ae49f(["schedule_ical_file"]):::queued --> x7aa56383a054e8ba(["site"]):::queued
x063edd335cc1b36f(["schedule_page_data"]):::queued --> x7aa56383a054e8ba(["site"]):::queued
xf38d3f5e6365ad72(["workflow_graph"]):::started --> x6e52cb0f1668cc22(["readme"]):::queued
xdf832f8e1f99baf2(["schedule_file"]):::queued --> x063edd335cc1b36f(["schedule_page_data"]):::queued
xdf832f8e1f99baf2(["schedule_file"]):::queued --> x35552a73efe9c59f(["schedule_ical_data"]):::queued
x35552a73efe9c59f(["schedule_ical_data"]):::queued --> x4d31f5a49d5ae49f(["schedule_ical_file"]):::queued
end
The font used throughout the site is Public Sans, an open source font developed as part of the General Services Administration’s USWDS (US Web Design System) for making accessible federal government websites.
The colors for the site and hex logo come from the Tam
palette in
MetBrewer
(MetBrewer::met.brewer("Tam")
):
Text and figures: All prose and images are licensed under Creative Commons (CC-BY-NC 4.0)
Code: All code is licensed under the MIT License.