05:00
Terminal
Open the folder:
RStudio: New Project > Existing Directory >
VS Code: File > Open Folder >
Open index.qmd
Preview. Edit. Save. Preview.
Cmd/Ctrl + Shift + K
Build > Render Website
Requires Quarto Extension
Get the starter template. If you’re using Posit Cloud, skip this step and instead open the whr-website
project. If you’re using Codespaces, follow the instructions here, but go to this repo instead.
Open index.qmd
and click Render/Preview.
Edit title
index.qmd
YAML to better reflect the site and add a subtitle
. Preview.
Add some text to index.qmd
explaining the plot. Preview.
05:00
index.qmd
---
title: "Global Happiness"
execute:
echo: false
warning: false
message: false
---
Data from: [World Happiness Report](https://www.worldhappiness.report/).
```{r}
#| label: setup
library(tidyverse)
library(quarto)
library(brand.yml)
whr <- read_csv(here::here("data/whr.csv"))
brand <- read_brand_yml("_brand.yml")
theme_whr <-
theme_brand_ggplot2("_brand.yml") +
theme(
plot.title = element_text(size = 14, face = "bold"),
plot.subtitle = element_text(size = 12)
)
```
Webpages are like any other Quarto document:
A minimal website has two files: index.qmd
and _quarto.yml
index.qmd
: Renders to index.html
, your home page.
_quarto.yml
: Controls project and website properties.
When rendered you will get a _site/
folder. This contains everything needed to serve the site.
_quarto.yml
Our website is a Quarto project.
All Quarto projects include a _quarto.yml
file.
This is a Quarto Project.
my-folder/
├── _quarto.yml
├── my-document.qmd
This is not.
my-folder/
├── my-document.qmd
A Quarto project is a directory that provides:
quarto render myproject
).Why didn’t we need this before?
Only some Quarto outputs require a Quarto project, including:
about.qmd
._quarto.yml
so that the navbar includes the about page.04:00
There are many more options for site navigation, including
Photo by Daniele Levis Pelusi on Unsplash
Like regular HTML documents and dashboards, you can use a built-in Bootswatch theme.
_quarto.yml
Learn more: https://quarto.org/docs/output-formats/html-themes.html
_quarto.yml
Control basic options like colors and fonts in _quarto.yml
.
_quarto.yml
Photo by engin akyurt on Unsplash
There are a variety of ways to publish Quarto documents, presentations, dashboards, and websites.
Learn more: https://quarto.org/docs/publishing/
Easily publish and share data applications and documents in a cloud environment within minutes.
Publish from:
Free publishing service for static content created with Quarto.
Learn more: https://quarto.org/docs/publishing/quarto-pub.html
Easiest option for today. https://quartopub.com/.
Quarto Pub
.Learn more: https://quarto.org/docs/publishing/quarto-pub.html
Publish your website to Quarto Pub.
quarto publish
, then select Quarto Pub
.If you have time, publish to Connect Cloud. Note: if you’re using R, you will need an renv.lock
file (learn how here) if publishing from Positron or VS Code, or a manifest.json
file (learn how here) if publishing from GitHub.
07:00
Learn more: https://quarto.org/docs/websites/