Customizing the Header
Files: src/config/config.toml, src/config/menu.<lang>.json, src/i18n/<lang>.json, src/layouts/components/global/header/ · Skill level: Beginner
The header contains following essential elements that you can customize using the links below:
- Logo – Update your site’s logo
- Menus – Organize and manage navigation menus. For dropdowns, flyouts, the mega menu, and keyboard support, see Navigation.
- Language switch – Manage your languages
- Navigation Button – Customize the call-to-action button (see below).
In the Tina edition, you edit these in Site settings, Menus, and Interface labels at /admin/. In the Sanity edition, the same three are in the Studio: Site settings below the languages, and Menus and Interface labels under each language.
Upstart has one header layout. The components are in src/layouts/components/global/header/, starting with Header.astro and Navbar.astro.
Customizing the Navigation Button
To enable or edit the navigation button in the header, open the config.toml file in the src/config folder and find the following section:
[settings.navigationButton] enable = true # Show or hide the button label = "" url = "/contact/" # Button linkIn the Tina and Sanity editions, this is Site settings > Settings > Navigation Button.
Updating the Button Label
The button label is in each language file, so it can change with the language. To change it:
- Open
src/i18n/en.json, then the same file for each of your other languages, such assrc/i18n/fr.jsonandsrc/i18n/ar.json. - Locate the
"navigation"section. - Update the
"buttonLabel"value.
In the Tina and Sanity editions, it is Button Label under Navigation in Interface labels, in each language.
Note: In Upstart, the button always shows
buttonLabel. Thelabelsetting inconfig.tomlis not used, so a value there changes nothing.
Example: English (en.json)
"navigation": { "buttonLabel": "Sign Up"}Example: French (fr.json)
"navigation": { "buttonLabel": "Commencez à utiliser"}Once updated, your navigation button will display the new label based on the selected language.
Sticky Header
stickyHeader under [settings] in config.toml keeps the header on screen as visitors scroll. Set it to false to turn this off. In the Tina and Sanity editions, it is Sticky Header under Site settings > Settings.