Build a website with Quarto
A single .qmd renders to a page. Point Quarto at a folder with a project file and it builds a whole website — navigation, search, theming and all. This very site is a Quarto project; here’s the shape of one.
The project file
A website is any directory containing a _quarto.yml with project: type: website:
project:
type: website
website:
title: "My Site"
navbar:
left:
- href: index.qmd
text: Home
- href: about.qmd
text: About
- href: blog.qmd
text: Blog
format:
html:
theme: cosmo
css: styles.cssEvery .qmd in the folder becomes a page; the navbar block wires them into the top menu. Add toc, search, a page-footer, social icons — it’s all declarative.
Rendering and previewing
From the project folder:
quarto preview # live-reloading local preview while you write
quarto render # build the whole site into _site/quarto preview rebuilds and refreshes the browser every time you save — the fastest way to work.
A blog with almost no effort
Drop a listing into any page and Quarto assembles an index from a folder of posts, complete with an RSS feed:
---
title: "Blog"
listing:
contents: posts
sort: "date desc"
categories: true
feed: true
---Each post is just a .qmd with a title, date and categories in its header. New file, next render, it’s on the site.
Publishing
One command pushes the rendered site live. Free options include:
quarto publish quarto-pub # Quarto Pub
quarto publish gh-pages # GitHub Pages
quarto publish netlify # NetlifyFor R-heavy sites, render locally first (so your machine’s R runs the code) and deploy the finished _site/ — that’s the pattern we use here. The full workflow is in the publishing lesson.
Why Quarto for a site
Your content, code and prose live in plain text under version control; the same document can be a web page and a PDF; and executable chunks mean charts and tables regenerate from data instead of being pasted in. For a technical or data-focused site, that’s hard to beat.
Thinking about a data-driven site, dashboard or documentation hub in R and Quarto? We can help you build it.