Navigation and links

Options controlling the sidebar navigation tree, in-page table of contents, and header link/icon behavior.

Header links

Every content-authored Markdown link and most theme-rendered links pass through link-target-attrs.html, which decides whether a link opens in a new tab based on external_links:

[params.external_links]
  new_tab    = true
  exceptions = ['https://docs.example.com/']

A URL is treated as internal (no new tab) if it’s not http(s), points back at site.BaseURL, or matches a prefix in exceptions. This is applied automatically to every Markdown-authored link via a render hook — you don’t need to add target="_blank" by hand anywhere in your content.

Page table of contents

The right sidebar renders secondary_sidebar_items (default ['page-toc'], which renders .TableOfContents from your Markdown headings via page-toc.html).

[params]
  secondary_sidebar_items = ['page-toc']

Hiding it on a single page

Set show_toc: false in a page’s frontmatter to hide the entire right sidebar for that page (it isn’t just the TOC — the whole secondary_sidebar_items slot is skipped):

---
title: A wide page with no right sidebar
show_toc: false
---

This is a Hugo-idiomatic per-page override — see Per-page overrides for how the fallback chain (page → site → hardcoded default) works generally.

Sidebar navigation

The left sidebar nav tree is built from site.Menus.sidebar — falling back to site.Menus.main if no sidebar menu is defined — rendered by sidebar-nav.html. This site’s own sidebar (see the left of this page) is built exactly this way; its hugo.toml defines [[menus.sidebar]] entries with identifier/parent/weight to create the grouped, collapsible tree you’re looking at.

A top-level entry with an empty url = '' and an identifier renders as an expandable group header; entries that set parent = "<identifier>" nest underneath it.