Lazy blogger menu (weird suffix, nested)

Similar to Section Menus for Lazy Bloggers with nested sections

Hi,

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>
            {{end}}
        </li>

    {{end}}
</ul>

‘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
– page1.md
- section2
– page2.md

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

-Section1s
-Section2s

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

Thank you for any help.
Nanella

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 _index.md for each section defining a title for the section
  3. Use the following code:

section-menu.html:

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

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.