Lazy blogger menu (weird suffix, nested)

Similar to Section Menus for Lazy Bloggers with nested sections


Question 1
I am trying to achieve a nested menu based on sections (lazy blogger menu). My partial for “normal” menus (aggregated via frontmatter or config.toml) looks like this:

<ul class="nav-list">
    {{ range .menu }}

        <li class="nav-item">
            {{ if .HasChildren }}
                <a class="nav-link" href="#">{{ .Page.Title }}</a>
                {{- partial "menu.html" (dict "menu" .Children)}}
            {{ else}}
                <a class="nav-link" href="{{ .URL }}">{{ .Name }}</a>


‘menu’ is given as a variable to the partial. For frontmatter-menus, this works just fine. But I also have a lazy blogger menu, which I would like to display nested as well (with the same partial). But that menu only displays the root sections. The doc is not quite clear about that for me:

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:

What exactly is meant by shadow-members? Can I somehow access the subsections and pages? I guess not, though I cannot figure out why one would limit that menu to root sections. It would be nice to provide such a feature to create a nested menu automatically based on the n-level sections and their pages.

Question 2
There is another thing that confuses me. My section layout is as follows:
- section1
- section2

Yet the names display in the lazy blogger menu are all suffixed by an ‘s’, so that the resulting menu displays as follows:


This only applies to lazy blogger menus. Where do these suffixes come from?

Thank you for any help.

Of course I got it working myself just after asking the question. Here’s how I solved it:

  1. Do not use the “lazy blogger menu” with sectionPagesMenu
  2. Add an for each section defining a title for the section
  3. Use the following code:


{{ range .menu }}
    <li><a href="{{ .URL }}">{{ .Name }}</a></li>
    {{ if .Sections }}
        {{- partial "section-menu.html" (dict "menu" .Sections)}}
    {{ end }}
{{ end }}

Use it wherever you need it like this:
{{- partial “section-menu.html” (dict “menu” .Site.Sections) -}}

Now both the nested sections problem and the suffix problem are fixed.