Navbar

Use the navbar shortcode to display a navigation header with a toggler.

Overview

Use the navbar shortcode to display a navigation header with a toggler. The menu items are derived from the site’s configuration, which defaults to the menus defined under main. Nested items are supported at one-level depth. The navigation bar includes a search area and a language switcher if applicable. The items in the navigation header are accentuated if the current page or any of its descendants is active.

Arguments

The shortcode supports the following arguments:

ArgumentRequiredDescription
pathYesRequired path of the active page.
menusNoOptional name of the menu configuration, defaults to “main”.
sizeNoOptional breakpoint of the navbar toggler, either “xs”, “sm”, “md” (default), “lg”, or “xl”.
colorNoOptional background color of the navbar, either “primary”, “secondary”, “success”, “danger”, “warning”, “info”, “light”, “dark”, “white”, “black” or “body”. Set the color to “body” for the navbar to respond to color mode changes (e.g. switching between dark and light). The navigation bar is transparent when no color is set, but is set to the body color when scrolling to enhance the contrast.
searchNoOptional flag to include a search input, defaults to the parameter “logo” set in the “navigation” section of the site’s parameter configuration.
logoNoOptional address of the logo image, defaults to the parameter “logo” set in the “navigation” section of the site’s parameter configuration.
titleNoOptional brand title, displayed when the logo is not set. Defaults to the site’s title.

Example

As an example, the following shortcode displays a navigation header with a body color.

markdown
{{< navbar path="credits" color="body" size="sm" search="false" menus="sample" title="Brand" >}}
Last updated: February 16, 2023 • Add transparent color behavior (b118244)