Getting Started
Quick Start
library(qrtdown)
# Initialize qrtdown in your package
use_qrtdown()
# Build the site
build_site()
# Preview in browser
preview_site()Coming from pkgdown?
qrtdown handles articles differently than pkgdown. Here’s what you need to know:
| pkgdown | qrtdown | |
|---|---|---|
| Article location | vignettes/ |
vignettes/articles/ |
| File format | .Rmd |
.qmd (or .Rmd, .md) |
| R CMD check | Vignettes are built | Articles are ignored |
| Config | Manual in _pkgdown.yml |
Auto-discovered |
Migration Steps
Create the articles directory:
dir.create("vignettes/articles", recursive = TRUE)Move your vignettes:
# Move all .Rmd files to articles/ fs::file_move( fs::dir_ls("vignettes", glob = "*.Rmd"), "vignettes/articles/" )Convert to .qmd (optional but recommended):
# Rename .Rmd to .qmd for (f in fs::dir_ls("vignettes/articles", glob = "*.Rmd")) { fs::file_move(f, fs::path_ext_set(f, "qmd")) }Remove vignette engine headers:
pkgdown vignettes have engine metadata that qrtdown articles don’t need:
# REMOVE this from your articles: vignette: > %\VignetteIndexEntry{Title} %\VignetteEngine{knitr::rmarkdown}Build:
use_qrtdown() build_site()
Why vignettes/articles/?
R treats files in vignettes/ as package vignettes. During R CMD check, R tries to build them, which can cause issues:
- Vignettes need special YAML headers
- Build failures block package submission to CRAN
- Long-running examples slow down checks
By placing website content in vignettes/articles/, qrtdown keeps your documentation separate from R’s vignette system. The articles/ subdirectory is ignored by R but rendered by qrtdown.
Important: If you put .qmd files directly in vignettes/ (not in the articles/ subdirectory), qrtdown will not find them.
Creating Articles
The “Get started” Article
Create the main introductory article for your package:
use_qrtdown_getting_started()This creates vignettes/articles/{packagename}.qmd and adds a separate “Get started” tab in the navbar (not in the Articles dropdown). This follows the pkgdown convention.
Regular Articles
For additional articles that appear in the Articles dropdown:
use_qrtdown_article("my-article", title = "My Article Title")This creates vignettes/articles/my-article.qmd with proper YAML front matter.
Linking to Articles
From README or Other Articles
Use relative paths with the .qmd extension:
See the [getting started guide](vignettes/articles/getting-started.qmd) for examples.Why .qmd extension?
- On the website: Quarto automatically converts to
.html - On GitHub/Codeberg: The link points to the viewable source file
This works well when your README content is shared between the repository and website.
How qrtdown Handles Your README
By default, qrtdown generates index.qmd which includes your README content:
your-package/
├── README.qmd # Your source file
└── index.qmd # Generated: includes README.qmd + adds sidebar
The generated index.qmd looks like:
---
title: mypackage
---
::: {.column-margin}
### Links
- [Source Code](...)
### Citation
[Citing this package](_qrtdown/citation.qmd)
:::
{{< include README.qmd >}}Your README stays untouched, and qrtdown adds the sidebar with package metadata.
Configuration
Minimal Setup
After running use_qrtdown(), you get a _qrtdown.yml:
url: https://github.com/yourname/yourpackage
template:
theme: cosmoThat’s often all you need. qrtdown auto-discovers:
- Articles in
vignettes/articles/ - Citation from
inst/CITATION - Changelog from
NEWS.md - Logo from
man/figures/logo.png
Common Customizations
Change theme:
template:
theme: flatlyAdd external links:
navbar:
right:
- icon: globe
href: https://yoursite.com
aria-label: WebsiteWhat NOT to Do
Don’t manually list articles with explicit paths:
# DON'T do this - paths won't work as expected
navbar:
left:
- text: Articles
menu:
- text: Guide
href: vignettes/guide.qmd # Wrong! Should be vignettes/articles/Instead, just indicate Articles should exist:
# DO this - qrtdown fills in the menu automatically
navbar:
left:
- text: Articlesqrtdown scans vignettes/articles/ and builds the dropdown menu for you.
Images and Static Assets
qrtdown automatically copies images to your built site. Here’s where to store them.
Where to Put Images
| Location | Use Case | How to Reference |
|---|---|---|
man/figures/ |
Logo and README images |  |
vignettes/articles/images/ |
Article images |  |
Package Logo
Store your logo at man/figures/logo.png (or .svg). It appears automatically in the navbar.
usethis::use_logo("path/to/your-logo.png")README Images
For images in your README, use man/figures/:
your-package/
├── README.md
└── man/
└── figures/
├── logo.png
└── screenshot.png
Reference in README.md:
Article Images
For images in articles, create an images/ folder inside vignettes/articles/:
vignettes/articles/
├── getting-started.qmd
├── advanced-usage.qmd
└── images/
├── diagram.png
├── screenshot.png
└── workflow.png
Reference in any article:
How It Works
qrtdown configures Quarto to copy these directories to your output:
man/figures/**- All package figuresvignettes/articles/**- All article subdirectories (includingimages/)
This happens automatically when you run build_site().
Troubleshooting
Articles not appearing?
- Check location: Files must be in
vignettes/articles/, notvignettes/ - Check extension: Must be
.qmd,.Rmd, or.md - Check for underscore: Files starting with
_are ignored (they’re partials) - Rebuild: Run
build_site()to regenerate the navbar
Links broken on website?
- Use
.qmdextension in links, not.html - Use correct path:
vignettes/articles/name.qmdfrom root - Check file exists: The target file must be in
vignettes/articles/
Site looks different when running quarto render directly?
Always use build_site(). It regenerates _quarto.yml with current content. Running quarto render directly may use stale configuration.
Run diagnostics
qrtdown_sitrep()This shows: - Quarto version and path - What content was detected - What pages will be generated - Navbar structure
Deploying Your Site
qrtdown supports automatic deployment via CI (recommended) or manual deployment.
How Automatic Deployment Works
The use_qrtdown_*_pages() functions create CI workflow files. They do not deploy your site directly. Instead:
- You run the setup function once (creates the workflow file)
- You commit and push the workflow file to your repository
- You enable CI in your repository settings
- From then on: Every push to
mainautomatically rebuilds and deploys your site
You never need to manually build or deploy again - just push your code.
GitHub Pages
use_qrtdown_github_pages()What it does: Creates .github/workflows/qrtdown.yaml
One-time setup after running:
- Commit and push the workflow file to GitHub
- Go to repository Settings > Pages
- Set Source to “GitHub Actions”
- Done! Future pushes to
mainauto-deploy
Codeberg Pages
Codeberg Pages serves static content directly from a pages branch - no CI is required:
# Build and deploy
build_site()
deploy_site()One-time setup after first deploy:
- Go to repository Settings > Pages
- Set branch to
pages - Your site will be at
https://<username>.codeberg.page/<repo>/
Manual Deployment
If you prefer to control when the site updates (or don’t want CI):
# Build locally
build_site()
# Push docs/ to the pages branch
deploy_site(branch = "pages")Run these commands each time you want to update your site.
Next Steps
- Configuration Guide - Detailed configuration options
?build_site- Function documentation?use_qrtdown_article- Creating articles programmatically