Skip to content

Commit

Permalink
Add config option to control child page limit (google#1334)
Browse files Browse the repository at this point in the history
Co-authored-by: Patrice Chalin <chalin@users.noreply.github.com>
  • Loading branch information
viren-nadkarni and chalin committed Aug 7, 2024
1 parent d728061 commit 13dc291
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions userguide/content/en/docs/adding-content/navigation.md
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,8 @@ By default, the section menu shows the current section fully expanded all the wa

With the compact menu (`.ui.sidebar_menu_compact = true`), only the current page's ancestors, siblings and direct descendants are shown. You can use the optional parameter `.ui.ul_show` to set a desired menu depth to always be visible. For example, with `.ui.ul_show = 1` the first menu level is always displayed.

The number of sidebar entries shown per section can be configured using the `.ui.sidebar_menu_truncate` parameter (default: 50).

As well as the completely expanded and compact menu options, you can also create a foldable menu by setting the site parameter `ui.sidebar_menu_foldable = true` in `hugo.toml`. The foldable menu lets users expand and collapse menu sections by toggling arrow icons beside the section parents in the menu.

On large sites (default: > 2000 pages) the section menu is not generated for each page, but cached for the whole section. The HTML classes for marking the active menu item (and menu path) are then set using JS. You can adjust the limit for activating the cached section menu with the optional parameter `.ui.sidebar_cache_limit`.
Expand Down

0 comments on commit 13dc291

Please sign in to comment.