I think that for now this is the final result (bellow).
Template is used to put together a collapsible menu, using bootstrap 3 (its css and js) along with required jquery, custom css and some custom java script.
On a large screen menu is a fixed collapsible sidebar with the brand image. On xs screens side bar moves out of the way and a burger icon appears top right, the brand image gets replaced by brand text. Clicking on the burger button activates custom java script which adds and removes classes to bring out or hide a full screen overlay menu.
Since menu order seems to be as followed: single items are put on top and parent items bellow, each ordered alphabetically (Bname of a single item is above Aname of a parent item) and weights seem to only affect child items. To get around this I have put a number in front of every parent name in front matter to customize the menu
menu:
mainmenu:
parent: 1PARENTNAME
name: Child name
weight: 2
and then used CSS
.nav-side-menu li::first-letter, .overlay li::first-letter {
font-size: 0px !important;
}
which basically means i made the size of the first letter to be zero, so it is not seen, but still applied during menu sorting -1, 0, 1, 2 etc
Since single items are ordered above the parent items i made another menu and attached it to the bottom of the first one to list single items for which i want to be bellow parent items.
There is no ARIA and there is no tested solution for cases without JS and CSS (who does that anyway? TOR browser users?). Maybe ARIA will be considered at a later date.
The template:
{{ $currentPage := . }}
<!-- used to set active for a parent of a current page child item if they match -->
<!-- used to set active for a child item menu link if it matches with the current page -->
<!-- used to set active for a menu link if it matches with the current page -->
<!-- MENU -->
<div id="overlayOuter" class="nav-side-menu">
<!-- Brand Image -->
<div class="brand hidden-xs"><img src="{{ "img/infinity.gif" | relURL}}" alt="infinity" height="64" width="128" /></div>
<!-- X Close Overlay -->
<a href="javascript:void(0)" class="closebtn visible-xs" onclick="closeNav()"><span class="button-color"><i class="fas fa-times"></i></span></a>
<div id="overlayInner">
<ul>
{{ range .Site.Menus.mainmenu }} <!-- loop through menu -->
{{ if .HasChildren }} <!-- if menu item has a child item, list names for each parent item -->
<li data-toggle="collapse" class="collapsed {{ if $currentPage.HasMenuCurrent "mainmenu" . }}active{{ end }}" data-target="#{{.Name}}"><a>{{ .Name }}</a></li>
<ul class="sub-menu collapse" id="{{.Name}}">
{{ range .Children }} <!-- loop through child items, list names foe each child item -->
<li class="{{ if $currentPage.IsMenuCurrent "mainmenu" . }}active{{ end }}"><i class="fas fa-angle-right"></i><a href="{{.URL}}">{{.Name}}</a></li>
{{end}} <!-- end child loop -->
</ul>
{{else}} <!-- if menu has no child items, list names for each item -->
<li class="single {{ if $currentPage.IsMenuCurrent "mainmenu" . }}active{{ end }}"><a href="{{.URL}}">{{.Name}}</a></li>
{{end}} <!-- end checks for child items -->
{{end}} <!-- end menu loop -->
{{ range .Site.Menus.bottom }} <!-- second menu loop -->
<li class="single {{ if $currentPage.IsMenuCurrent "bottom" . }}active{{ end }}"><a href="{{.URL}}">{{.Name}}</a></li>
{{end}} <!-- end second menu loop -->
</ul>
<div class="social">
<a href="" target="_blank"><i class="fab fa-facebook-square fa-2x"></i></a>
<a href="" target="_blank"><i class="fab fa-twitter-square fa-2x"></i></a>
<a href="" target="_blank"><i class="fab fa-linkedin fa-2x"></i></a>
<a href="" target="_blank"><i class="fab fa-instagram fa-2x"></i></a>
</div>
</div>
</div>
<!-- /MENU -->
<!-- Burger Open Overlay -->
<span class="button-color navbar-toggle" onclick="openNav()"><i class="fas fa-bars fa-2x"></i></span>
<!-- Brand Text -->
<div class="brand-overlay visible-xs">E–pomoÄŤ</div>
menu thingy is not optimal solution and ie,edge and safari don’t seem to know what a negative number is, so only order with positive numbers…have not tried it in chrome. long live firefox
maybe also title="{{ .Name }}"
should be added to <a>