Appendix B — Quarto Website
This note is a step-by-step guide to publishing on Quarto Pub with RStudio.
B.1 Installation
Install Quarto
Download Quarto: Go to Quarto website and download the installer for your operating system (Windows/macOS/Linux).
Run the Installer: Follow the prompts to install Quarto. This adds the
quartocommand-line tool to your system.
Install the Quarto R Package
- Open RStudio
- Install the Quarto R package by running the following command in the console:
install.packages("quarto")- Restart RStudio to ensure the Quarto integration works properly.
Verify Installation
- Open the Terminal pane in RStudio (not Console).
- Type
quarto checkand press Enter. - Confirm that Quarto and required dependencies (e.g., Pandoc) are installed. Fix any issues if prompted.
Create a Quarto Pub Account
- Go to Quarto Pub and sign up for a free account.
- Verify your email to activate the account.
B.2 Quarto Publish with RStudio
Create a New Quarto Website Project
- In RStudio, go to File > New Project > New Directory > Quarto Website.
- Name your project (e.g.,
firstname-website) and choose a save location (e.g., under yourdjrfolder). - Click Create Project: This generates a basic website template with
index.qmdandabout.qmd.
.Rproj: RStudio project fileindex.qmd: Homepage contentabout.qmd: About page content_quarto.yml: Site configuration settingsstyles.css: Custom CSS styles
Edit Website Content
- Edit
index.qmdto add content to your homepage. - Edit
about.qmdto add an about page. - Modify the
_quarto.ymlfile to configure site settings (title, navigation, theme).
Preview Your Website Locally
- Click the Render button in RStudio to preview your website.
Publish Your Website
Use your direction keys to navigate and select options, and press Enter to confirm your choices.
- Open the Terminal pane in RStudio.
- Type
quarto publishand press Enter. Provider?: SelectQuarto Pubas your publishing destination.- Authorize the connection to Quarto Pub.
Publishing with account?: Confirm your Quarto pub account.Site name?: Confirm your site name.- Follow the on-screen instructions to complete the publishing process.
View Your Published Website
- Once the publishing process is complete, your website will be live at
https://quartopub.com/yourusername/yourprojectname. - Share the link with others to showcase your work!
B.3 Updating Quarto Website
B.4 Updating Content
- To update your website, make changes to your
.qmdfiles and re-publish usingquarto publish. Publish updates to:Confirm site link and press Enter.- Your website will be automatically updated with the new content.
Website Structure
Let’s say if you want your website have 4 pages:
- Home page to show the content of
index.qmd - About page to show the content of
about.qmd Data Cleaningto show the content ofdata-cleaning.qmdData Analysisto show the content ofdata-analysis.qmd
First, in addition to the existing index.qmd and about.qmd, you need to create two new .qmd files:
data-cleaning.qmddata-analysis.qmd.
Then, you need to modify the _quarto.yml file to add the new pages to the navigation bar.
Open
_quarto.ymlin RStudio.Revise your
nav_barsection to include the new pages:
nav_bar:
- text: Home
href: index.html
- text: About
href: about.html
- text: Data Cleaning
href: data-cleaning.html
- text: Data Analysis
href: data-analysis.html- Save the
_quarto.ymlfile. - Click the Render button in RStudio to preview your updated website.
- Publish your updated website using
quarto publish.
Each .qmd file should be self-contained. This means: (1) Load all required packages using library() at the top of each file. (2) Load any data needed directly in that file. Do not assume code from other .qmd files will run before this one.
B.5 Remove Quarto Webiste
- Go to your Quarto Pub account.
- Click on the project you want to delete.
- Click
Delete Siteto remove the website from Quarto Pub.