Skip to content

Customize the Header Links

Arpit Sheth edited this page Jul 30, 2020 · 1 revision

The header has links in two main components:

  1. HeaderNav — The top header bar that should contain just the most important links
  2. HeaderMenu — The toggle header menu that can contain as many links as you like!

Customize the Header Nav Items

  1. Create a directory to shadow the theme data if it doesn't exist yet /src/@shetharp/gatsby-theme-polaroid/data/
  2. Create a file for header-nav-items.ts
  3. Provide a list of headerNavItems
    • You can configure links to be internal (with a slug property) or external (with a href property)
    • You can also specify if a link should be visible on mobile, tablet, or laptop
    • I recommend keeping this list short (no more than 5 links)

Customize the toggle Header Menu Items

  1. Create a directory to shadow the theme data if it doesn't exist yet /src/@shetharp/gatsby-theme-polaroid/data/
  2. Create a file for header-menu-items.ts
  3. Provide a list of headerMenuItems
    • You can configure links to be internal (with a slug property) or external (with a href property)
    • You can also specify if a link should be visible on mobile, tablet, or laptop. If a link is already visible in the HeaderNavItems, I like to hide it in the HeaderMenuItems.
Clone this wiki locally