White Cabinet

Hugo Theme

Creating the header menu

Posted on 9 Mar, 2020

The header menu is the set of links on the bottom edge of the black banner on the top part of the page. It can be an internal link to a certain page in your website that is often visited, an external link to another website, or a button to switch the content language.

topfigures_headermenu_fig

The most basic way to add a new header menu is to add a new parameter block menu.header in the config.toml. Suppose you want to add a header menu entry for the content at /URL, you should add

[[menu.header]]
   name = "DISPLAYED NAME"
   url = "/URL"
   weight = 1

where the weight specifies the order of the header menu when there are multiple entries.

You can also add external links with small banners. Add a new parameter block Params.exlink in the config.toml:

[[Params.exlink]]
  url = "LINK"
  pass = "PATH TO IMAGES"

Language-switch button

The link for switching languages is created by the parameter block Languages.**.params:

[Languages.en]
  weight = 1
[Languages.en.params]
  Language_name = "English"

The weight corresponds to the order in which the languages are placed, and the Language_name is the string that is displayed for the language. See also Going global for an example.