Section Menus for Lazy Bloggers with nested sections


TLDR: Just seeking clarification whether lazy menus are designed to be able to handle nested sections.

It may be easier to explain with an example:

What the docs say:

To enable this menu, configure sectionPagesMenu in your site config :

This will create a menu with all the sections as menu items and all the sections’ pages as “shadow-members”. The shadow implies that the pages isn’t represented by a menu-item themselves, but this enables you to create a top-level menu like this:

I read this to mean that if you follow the above, Hugo will create a menu item for each section, which could then mean either:

  • One menu item for each root / top-level section, or
  • One menu item for each section, including sub-sections, regardless of its nesting position.

What I’ve found happens though:

  • Only one menu item gets created, corresponding to each root section
  • but it may take one of the nested sub-sections as a menu item


Hugo generates this menu, given the below section structure ( where each node is a section, each section contains an, and each section has at least one non-section page inside (omitted here for brevity):

Menu Items Generated

  • Bryophytes ( 2.1.1 )
  • Deuterostomia ( )

Section Structure

* Animals
  * Eumetazoa
    * Bilaterally Symmetric
      * Acoelomates
      * Pseudo Coelomates
      * Coelomates
        * Deuterostomia
        * Protostomia
    * Radially Symmetric
  * Parazoa
* Plants
  * Non Vascular
    * Bryophytes
  * Vascular
    * Spore Producing
    * Seed Producing
      * Non Flowering
      * Flowering

I am asking out of curiosity; I don’t usually use the lazy menus feature, as I prefer to configure my menus either on config.toml or front matter.