Customizing Navigation
Adding Items
Text Links
navbar:
left:
- text: Get started
href: vignettes/articles/getting-started.qmd
- text: Reference
href: reference.qmdIcon Links
Use Bootstrap Icons for the right side:
navbar:
right:
- icon: github
href: https://github.com/yourname/pkg
aria-label: GitHub
- icon: mastodon
href: https://fosstodon.org/@yourname
aria-label: MastodonCommon icons: github, code-square, mastodon, twitter, rss, envelope.
The Articles Dropdown
The “Articles” navbar item is special. Just indicate it should exist:
navbar:
left:
- text: ArticlesAt build time, qrtdown:
- Scans
vignettes/articles/for.qmd,.Rmd, and.mdfiles - Extracts each article’s title from YAML front matter
- Generates a dropdown menu automatically
If you have more than 5 articles, qrtdown shows the first 5 plus a “More articles…” link to the articles index page.
Adding Articles
use_qrtdown_article("new-feature", "New Feature Guide")
build_site() # Article appears in dropdown automaticallyGet Started Tab
Create a “Get started” article that gets its own navbar tab:
use_qrtdown_getting_started()This creates vignettes/articles/{packagename}.qmd. Articles named after your package, “getting-started”, or “index” automatically get a separate navbar tab rather than appearing in the Articles dropdown.
Citation Link
The Citation link appears automatically when inst/CITATION exists:
use_qrtdown_citation() # Creates inst/CITATION from DESCRIPTION
build_site() # "Citation" link appears in navbarNo need to manually add it to your config.
Reordering Items
Simply change the order in your config:
navbar:
left:
- text: Get started
href: vignettes/articles/mypackage.qmd
- text: Articles
- text: Reference
href: reference.qmd
- text: Changelog
href: NEWS.mdRemoving Items
Delete the item from the list. For example, to remove the Changelog:
navbar:
left:
- text: Reference
href: reference.qmd
- text: Articles
# Changelog removedComplete Example
navbar:
title: "mypackage 0.1.0"
left:
- text: Get started
href: vignettes/articles/mypackage.qmd
- text: Reference
href: reference.qmd
- text: Articles
- text: Changelog
href: NEWS.md
right:
- icon: github
href: https://github.com/yourname/mypackage
aria-label: GitHub
- icon: code-square
href: https://codeberg.org/yourname/mypackage
aria-label: Codeberg