Websites

ASA Traveling Course: From R Markdown to Quarto

Dr. Mine Çetinkaya-Rundel

Duke University + Posit

2023-04-28

Anatomy of a Quarto project

Quarto projects

  • Quarto projects have a _quarto.yml file

  • The type field in this file indicates the type of project:

    • default: Collection of documents

    • website: Websites (and blogs)

    • books: Books 😃

Our turn

Let’s build a website together from all of the documents we’ve created so far and highlight the following features of Quarto websites:

  • _quarto.yml

  • index.qmd / landing page

  • Navigation

  • Freeze

  • Themes and dark theme toggle

  • Publishing

  • An aspect of the workshop webpage that you fancy?

Your turn

Pick up where we left off and

  • Add an about page.
  • Add a folder called posts and create a few minimal blog post entries. Then, using the listings feature, create a blog page for your website.
15:00

Wrap up

Freeze

  • The freeze option controls when/if computational documents be re-rendered during a global project render:
execute:
  freeze: true  # never re-render during project render
execute:
  freeze: auto  # re-render only when source changes
execute:
  freeze: false  # always re-render
  • The freeze option is typically added to a _metadata.yml file within a specific directory, affecting all files in that directory.

  • For blogs, set feeze in _metadata.yml at the root of the posts directory.

  • You can have it only within specific subdirectories for more complex sites.

Freeze vs. cache

  • Cache stores the results of computations for a specific file.

  • Cache invalidation is triggered by changes in chunk source code (or other cache attributes you’ve defined).

  • cache can also be set at the chunk level. Consider using the cache for computationally expensive chunks.

Publishing

See https://quarto.org/docs/publishing for publishing options other than Quarto Pub.

Wrap up

Questions

Any questions / anything you’d like to review before we wrap up this module?

Time permitting

Demo journal articles with Quarto with the JASA template!

Parting remarks

Quarto CLI…

orchestrates each step of rendering

A schematic representing rendering of Quarto documents from .qmd, to knitr or jupyter, to plain text markdown, then converted by pandoc into any number of output types including html, PDF, or Word document.

Artwork from “Hello, Quarto” keynote by Julia Lowndes and Mine Çetinkaya-Rundel, presented at RStudio Conference 2022. Illustrated by Allison Horst.

Learning more

https://quarto.org

Follow up with…

the Quarto Blog: https://quarto.org/docs/blog

Thank you!

🐘 https://fosstodon.org/@minecr

🐦 @minebocek