level 4 -}}
    {{- return -}}
  {{- end -}}

  {{- $context := .context -}}
  {{- $page := .page }}
  {{- $pageURL := .page.RelPermalink -}}
  {{- $level := .level -}}
  {{- $toc := .toc | default false -}}

  {{- with $items := union .context.RegularPages .context.Sections -}}
    {{- $items = where $items "Params.sidebar.exclude" "!=" true -}}
    {{- if eq $level 0 -}}
      {{- range $items.ByWeight }}
        {{- if .Params.sidebar.separator -}}
          <li class="[word-break:break-word] mt-5 mb-2 p