Skip to content

Commit

Permalink
Update default navbar structure (#2595)
Browse files Browse the repository at this point in the history
  • Loading branch information
salim-b authored May 28, 2024
1 parent 2417d58 commit edc41f4
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions vignettes/customise.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ The following sections show you how.

Please note that pkgdown's default theme has been carefully optimised to be accessible, so if you make changes, make sure that to also read `vignette("accessibility")` to learn about potential accessibility pitfalls.

### Light switch
### Light switch {#light-switch}

You can provide a "light switch" to allow your uses to switch between dark and light themes by setting the `light-switch` template option to true:

Expand Down Expand Up @@ -257,10 +257,10 @@ This is the default structure:
navbar:
structure:
left: [intro, reference, articles, tutorials, news]
right: [search, github]
right: [search, github, lightswitch]
```

It makes use of the the six built-in components:
It makes use of the the following built-in components:

- `intro`: "Get Started", which links to a vignette or article with the same name as the package[^dots].
- `reference`, if there are any `.Rd` files.
Expand All @@ -269,6 +269,7 @@ It makes use of the the six built-in components:
- `news`, if `NEWS.md` exists.
- `search`, the search box (see `?build_search` for more details).
- `github`, a link to the source repository (with an icon), if it can be automatically determined from the `DESCRIPTION`.
- `lightswitch`, a ["light switch"](#light-switch) to select light mode, dark mode, or auto mode.

[^dots]: Note that dots (`.`) in the package name need to be replaced by hyphens (`-`) in the vignette filename to be recognized as the intro. That means for a
package `foo.bar` the intro needs to be named `foo-bar.Rmd`.
Expand Down

0 comments on commit edc41f4

Please sign in to comment.