-
Notifications
You must be signed in to change notification settings - Fork 3
Adding new navbar pages
Samantha Csik edited this page May 23, 2023
·
3 revisions
_quarto.yml
is the website configuration file
_quarto.yml
is a special file in that it:
- defines how to "stitch" together all of our individual pages into one beautiful website 😃
- defines project-level metadata, which is inherited by all other files in the project directory
The Openscapes _quarto.yml
file currently comprises four main sections:
-
project
: defines the Quarto project type as awebsite
-
website
: update the navbar happen here -
page-footer
: update the page footer here -
format
: apply site-wide formatting (e.g. main font style, link a stylesheet(s), etc.)
The following instructions focus on updating the website navbar.
-
index.qmd
is the website landing page and should (must?) live in the project's root directory - all other webpage
.qmd
files (except for events and blog posts) also live in the root directory -- these can get moved into a subdirectory if desired
Adding and linking a new webpage in the navbar is easy!
- Create a new page by adding a
.qmd
file to the root directory (if following the conventions above) - Navbar pages are added under the
navbar
YAML option. Thetext
options allows you to specify how you'd like the page title text to appear in the navbar. Thehref
option is the file path to the.qmd
file (if it's saved to the project's root directory, you only need the file name). You are able to add pages directly to the navbar or as submenu pages. See the example below:
# ~ additional metadata omitted for brevity ~
website: # all pages get "stitched" together under the `website` section of `_quarto.yml`
navbar:
# ~ additional metadata omitted for brevity ~
right:
- text: "HOME"
href: index.qmd
- text: "THIS IS MY NEW PAGE" # text as you'd like it to appear in the navbar
href: my_new_page.qmd # file that you are linking
- text: "ABOUT"
menu:
- text: "WHO ARE WE?"
href: who_are_we.qmd
- text: "OUR APPROACH"
href: approach.qmd
- text: "MY NEW SUBMENU PAGE" # text as you'd like it to appear in the navbar dropdown menu
href: my_new_submenu_page.qmd # file that you are linking
# ~ additional metadata omitted for brevity ~
The above _quarto.yml
would generate this:
Check out the Quarto documentation on website navigation for many more options, examples, and instructions.