<aside>
  <nav id="sidebar-menu">
  {{ $currentPage := . }}
  <ul>
    {{ range .Site.Menus.main }}
        <li class="{{ .Identifier }}{{ if ($currentPage.IsMenuCurrent "main" . ) }} active{{ end }}{{ with .Params.imp }} imp{{ end }}"><a href="{{ .URL }}" {{ with .Params.imp }}class="imp"{{ end }}{{ with .Params.extern }} target="_blank"{{ end }}>{{ with .Pre }}{{ . }} {{ end }}{{ .Name }}</a></li>
        {{ if and (.HasChildren) (or ($currentPage.HasMenuCurrent "main" . ) ($currentPage.IsMenuCurrent "main" . )) }}
        <ul class="subnavi">
           {{ range .Children }}
           <li class="{{ .Identifier }}{{ if ($currentPage.IsMenuCurrent "main" . ) }} active{{ end }}"><a href="{{ .URL }}"{{ with .Params.extern }} target="_blank"{{ end }}>{{ .Name }}</a></li>
           {{ end }}
        </ul>
        {{ end }}
        
        
    {{ end }}
    </ul>
  </nav>
</aside>
