Skip to content

Navigation

Lukas Joswiak edited this page Jun 27, 2020 · 1 revision

The navigation (or menu) bar is the row of links at the top of each page. Etch allows customization of these links through the standard Hugo menu configuration method. Menus can be defined in a pages front matter or in the sites configuration. Examples of both methods are shown below.

Site Configuration

Adding a menu item in your site configuration file (config.toml) looks something like this. The Hugo Documentation has more information.

baseURL = "https://example.com"
theme = "etch"
# ...

[menu]
  [[menu.main]]
    identifier = "about"
    name = "about"
    title = "about"
    url = "/about/"
    weight = 20

Front Matter

You can also add a menu item from a pages front matter. For example, say you have the page content/about/index.md. The following is how you would create a menu item for the page.

---
title: "About"
menu:
  main:
    weight: 20
---
Some text about me...

Or the equivalent with TOML syntax.

+++
title = "About"
[menu.main]
  weight = 20
+++
Some text about me...
Clone this wiki locally