Publishing HTML

Overview

This article covers the various ways you can publish Quarto HTML documents, including publishing to a hosting service or sharing a standalone HTML file using E-mail, Dropbox, etc.

Note that it’s also possible to publish collections of Quarto documents as a website. See the article on Publishing Basics for additional details.

Publish Command

The quarto publish command provides a straightforward way to publish documents to Quarto Pub, GitHub Pages, Netlify, and Posit Connect.

For example, here are the commands to publish document.qmd to each of these services:

Terminal
quarto publish quarto-pub document.qmd
quarto publish gh-pages document.qmd
quarto publish netlify document.qmd
quarto publish connect document.qmd

For simple publishing of individual documents there’s not much more to learn than quarto publish.

Here’s a brief overview of the various supported services and when they might be an appropriate choice:

Destination Description
Quarto Pub Publishing service for Quarto documents, websites, and books. Use Quarto Pub when you want a free, easy to use service for publicly available content.
GitHub Pages Publish content based on source code managed within a GitHub repository. Use GitHub Pages when the source code for your document or site is hosted on GitHub.
Posit Connect Publishing platform for secure sharing of data products within an organization. Use Posit Connect when you want to publish content within an organization rather than on the public internet.
Posit Cloud Create data projects and publish results from your web browser. Use Posit Cloud when you want to organize all your static documents and interactive applications in one place.
Netlify Professional web publishing platform. Use Netlify when you want support for custom domains, authentication, previewing branches, and other more advanced capabilities.
Other Services Content rendered with Quarto uses standard formats (HTML, PDFs, MS Word, etc.) that can be published anywhere. Use this if one of the methods above don’t meet your requirements.

Note that the documentation linked to above generally references publishing an entire project (website or book) but all of the commands work just the same if you publish an individual document or presentation as demonstrated above.

Standalone HTML

You can optionally render Quarto documents into self contained HTML, whereby all of the content required to render the article (images generated by plots, required CSS and JavaScript, etc.) are bundled into a single HTML file. Use the embed-resources option to do this:

format:
  html:
    embed-resources: true

Then, you can share this HTML file using the same means you use to share other document types like spreadsheets, presentations, and PDFs (e.g by uploading it to Dropbox or any other file sharing service).

Note that when using embed-resources: true, math libraries like MathJax and KaTeX are not embedded by default because they are quite large and often time consuming to download. If you do want to embed math libraries, add the self-contained-math: true option:

format:
  html:
    embed-resources: true
    self-contained-math: true