Shortcut Menu

The sidebar contains your content’s navigation menu, but you can also add extra menu entries or shortcuts in a separate section.

For internal links, use the pageRef property instead of url. Learn more about Hugo’s menu configuration.

Title

Option By default, the shortcut menu has a title ("More" in English).

You can disable this title with disableShortcutsTitle=true.

hugo.
[params]
  disableShortcutsTitle = true
params:
  disableShortcutsTitle: true
{
   "params": {
      "disableShortcutsTitle": true
   }
}

To change the title, update your local i18n translation file.

[shortcuts-menuTitle]
other = "Other Great Stuff"

Single Language Example

Edit hugo.toml and add [[menu.shortcuts]] entries for each link:

hugo.
[menu]
  [[menu.shortcuts]]
    name = 'GitHub Repo'
    pre = '<i class="fa-fw fab fa-github"></i> '
    url = 'https://github.com/McShelby/hugo-theme-relearn'
    weight = 10

  [[menu.shortcuts]]
    name = 'Showcases'
    pageRef = '/showcase'
    weight = 20

  [[menu.shortcuts]]
    name = 'Credits'
    pageRef = '/more/credits'
    weight = 30

  [[menu.shortcuts]]
    name = 'Tags'
    pageRef = '/tags'
    pre = '<i class="fa-fw fas fa-tags"></i> '
    weight = 40

  [[menu.shortcuts]]
    name = 'Categories'
    pageRef = '/categories'
    pre = '<i class="fa-fw fas fa-layer-group"></i> '
    weight = 50
menu:
  shortcuts:
  - name: GitHub Repo
    pre: '<i class="fa-fw fab fa-github"></i> '
    url: https://github.com/McShelby/hugo-theme-relearn
    weight: 10
  - name: Showcases
    pageRef: /showcase
    weight: 20
  - name: Credits
    pageRef: /more/credits
    weight: 30
  - name: Tags
    pageRef: /tags
    pre: '<i class="fa-fw fas fa-tags"></i> '
    weight: 40
  - name: Categories
    pageRef: /categories
    pre: '<i class="fa-fw fas fa-layer-group"></i> '
    weight: 50
{
   "menu": {
      "shortcuts": [
         {
            "name": "GitHub Repo",
            "pre": "\u003ci class=\"fa-fw fab fa-github\"\u003e\u003c/i\u003e ",
            "url": "https://github.com/McShelby/hugo-theme-relearn",
            "weight": 10
         },
         {
            "name": "Showcases",
            "pageRef": "/showcase",
            "weight": 20
         },
         {
            "name": "Credits",
            "pageRef": "/more/credits",
            "weight": 30
         },
         {
            "name": "Tags",
            "pageRef": "/tags",
            "pre": "\u003ci class=\"fa-fw fas fa-tags\"\u003e\u003c/i\u003e ",
            "weight": 40
         },
         {
            "name": "Categories",
            "pageRef": "/categories",
            "pre": "\u003ci class=\"fa-fw fas fa-layer-group\"\u003e\u003c/i\u003e ",
            "weight": 50
         }
      ]
   }
}

Multilingual Example

For multilingual sites, set different menus for each language in hugo.toml:

hugo.
[languages]
  [languages.en]
    languageName = 'English'
    title = 'Hugo Relearn Theme'
    weight = 1

    [languages.en.menu]
      [[languages.en.menu.shortcuts]]
        name = 'GitHub Repo'
        pre = '<i class="fa-fw fab fa-github"></i> '
        url = 'https://github.com/McShelby/hugo-theme-relearn'
        weight = 10

      [[languages.en.menu.shortcuts]]
        name = 'Showcases'
        pageRef = '/showcase'
        weight = 20

      [[languages.en.menu.shortcuts]]
        name = 'Credits'
        pageRef = '/more/credits'
        weight = 30

      [[languages.en.menu.shortcuts]]
        name = 'Tags'
        pageRef = '/tags'
        pre = '<i class="fa-fw fas fa-tags"></i> '
        weight = 40

      [[languages.en.menu.shortcuts]]
        name = 'Categories'
        pageRef = '/categories'
        pre = '<i class="fa-fw fas fa-layer-group"></i> '
        weight = 50

  [languages.pir]
    languageName = 'Arrr! Pirrratish'
    title = 'Captain Hugo Relearrrn Theme'
    weight = 2

    [languages.pir.menu]
      [[languages.pir.menu.shortcuts]]
        identifier = 'ds'
        name = '<i class="fa-fw fab fa-github"></i> GitHub Repo'
        url = 'https://github.com/McShelby/hugo-theme-relearn'
        weight = 10

      [[languages.pir.menu.shortcuts]]
        name = '<i class="fa-fw fas fa-camera"></i> Showcases'
        pageRef = '/showcase'
        weight = 11

      [[languages.pir.menu.shortcuts]]
        name = 'GitHub Repo'
        pre = '<i class="fa-fw fab fa-github"></i> '
        url = 'https://github.com/McShelby/hugo-theme-relearn'
        weight = 10

      [[languages.pir.menu.shortcuts]]
        name = 'Showcases'
        pageRef = '/showcase'
        weight = 20

      [[languages.pir.menu.shortcuts]]
        name = 'Crrredits'
        pageRef = '/more/credits'
        weight = 30

      [[languages.pir.menu.shortcuts]]
        name = 'Arrr! Tags'
        pageRef = '/tags'
        pre = '<i class="fa-fw fas fa-tags"></i> '
        weight = 40

      [[languages.pir.menu.shortcuts]]
        name = 'Categorrries'
        pageRef = '/categories'
        pre = '<i class="fa-fw fas fa-layer-group"></i> '
        weight = 50
languages:
  en:
    languageName: English
    menu:
      shortcuts:
      - name: GitHub Repo
        pre: '<i class="fa-fw fab fa-github"></i> '
        url: https://github.com/McShelby/hugo-theme-relearn
        weight: 10
      - name: Showcases
        pageRef: /showcase
        weight: 20
      - name: Credits
        pageRef: /more/credits
        weight: 30
      - name: Tags
        pageRef: /tags
        pre: '<i class="fa-fw fas fa-tags"></i> '
        weight: 40
      - name: Categories
        pageRef: /categories
        pre: '<i class="fa-fw fas fa-layer-group"></i> '
        weight: 50
    title: Hugo Relearn Theme
    weight: 1
  pir:
    languageName: Arrr! Pirrratish
    menu:
      shortcuts:
      - identifier: ds
        name: <i class="fa-fw fab fa-github"></i> GitHub Repo
        url: https://github.com/McShelby/hugo-theme-relearn
        weight: 10
      - name: <i class="fa-fw fas fa-camera"></i> Showcases
        pageRef: /showcase
        weight: 11
      - name: GitHub Repo
        pre: '<i class="fa-fw fab fa-github"></i> '
        url: https://github.com/McShelby/hugo-theme-relearn
        weight: 10
      - name: Showcases
        pageRef: /showcase
        weight: 20
      - name: Crrredits
        pageRef: /more/credits
        weight: 30
      - name: Arrr! Tags
        pageRef: /tags
        pre: '<i class="fa-fw fas fa-tags"></i> '
        weight: 40
      - name: Categorrries
        pageRef: /categories
        pre: '<i class="fa-fw fas fa-layer-group"></i> '
        weight: 50
    title: Captain Hugo Relearrrn Theme
    weight: 2
{
   "languages": {
      "en": {
         "languageName": "English",
         "menu": {
            "shortcuts": [
               {
                  "name": "GitHub Repo",
                  "pre": "\u003ci class=\"fa-fw fab fa-github\"\u003e\u003c/i\u003e ",
                  "url": "https://github.com/McShelby/hugo-theme-relearn",
                  "weight": 10
               },
               {
                  "name": "Showcases",
                  "pageRef": "/showcase",
                  "weight": 20
               },
               {
                  "name": "Credits",
                  "pageRef": "/more/credits",
                  "weight": 30
               },
               {
                  "name": "Tags",
                  "pageRef": "/tags",
                  "pre": "\u003ci class=\"fa-fw fas fa-tags\"\u003e\u003c/i\u003e ",
                  "weight": 40
               },
               {
                  "name": "Categories",
                  "pageRef": "/categories",
                  "pre": "\u003ci class=\"fa-fw fas fa-layer-group\"\u003e\u003c/i\u003e ",
                  "weight": 50
               }
            ]
         },
         "title": "Hugo Relearn Theme",
         "weight": 1
      },
      "pir": {
         "languageName": "Arrr! Pirrratish",
         "menu": {
            "shortcuts": [
               {
                  "identifier": "ds",
                  "name": "\u003ci class=\"fa-fw fab fa-github\"\u003e\u003c/i\u003e GitHub Repo",
                  "url": "https://github.com/McShelby/hugo-theme-relearn",
                  "weight": 10
               },
               {
                  "name": "\u003ci class=\"fa-fw fas fa-camera\"\u003e\u003c/i\u003e Showcases",
                  "pageRef": "/showcase",
                  "weight": 11
               },
               {
                  "name": "GitHub Repo",
                  "pre": "\u003ci class=\"fa-fw fab fa-github\"\u003e\u003c/i\u003e ",
                  "url": "https://github.com/McShelby/hugo-theme-relearn",
                  "weight": 10
               },
               {
                  "name": "Showcases",
                  "pageRef": "/showcase",
                  "weight": 20
               },
               {
                  "name": "Crrredits",
                  "pageRef": "/more/credits",
                  "weight": 30
               },
               {
                  "name": "Arrr! Tags",
                  "pageRef": "/tags",
                  "pre": "\u003ci class=\"fa-fw fas fa-tags\"\u003e\u003c/i\u003e ",
                  "weight": 40
               },
               {
                  "name": "Categorrries",
                  "pageRef": "/categories",
                  "pre": "\u003ci class=\"fa-fw fas fa-layer-group\"\u003e\u003c/i\u003e ",
                  "weight": 50
               }
            ]
         },
         "title": "Captain Hugo Relearrrn Theme",
         "weight": 2
      }
   }
}

Displaying Pages Only in the Shortcuts Menu

To show pages only in the shortcuts menu you have two choices

  1. Create a headless branch bundle, _index.md in its own folder with the below front matter. The branch bundle will not be contained in the sitemap.

    content/showcase/_index.en.md
    +++
    title = 'Showcase'
    
    [_build]
      list = 'never'
      publishResources = true
      render = 'always'
    +++
    ---
    _build:
      list: never
      publishResources: true
      render: always
    title: Showcase
    ---
    {
       "_build": {
          "list": "never",
          "publishResources": true,
          "render": "always"
       },
       "title": "Showcase"
    }
  2. Or, put a child page inside a headless branch bundle with the following front matter in the bundle. This causes the child but not the branch bundle to be contained in the sitemap.

    content/more/_index.en.md
    +++
    [_build]
      list = 'never'
      publishResources = false
      render = 'never'
    +++
    ---
    _build:
      list: never
      publishResources: false
      render: never
    ---
    {
       "_build": {
          "list": "never",
          "publishResources": false,
          "render": "never"
       }
    }

    The child page can be any type of content.

    content/more/credits_index.en.md
    +++
    title = 'Credits'
    +++
    ---
    title: Credits
    ---
    {
       "title": "Credits"
    }