Open toplist2048 opened 7 years ago
can you provide a visual example of you expectation ?
Your idea seems good to be implemented
Hi,
Thanks for response! :)
I did some patch by myself. it is not a perfect fix, only the first level menus are removed.
for example
L1 ll1 ll2 L2 ll1 ll2
in ll1 page, the sub menu will be
L1 ll1 ll2 L2
so the sub menu in L2 is removed, space saved.
It saves lots of space if you have more than 100 items in L2.
the code is simple, please check.
============================================================
{{ $currentNode := . }} {{ $showvisitedlinks := .Site.Params.showVisitedLinks }} {{ if eq .Site.Params.ordersectionsby "title" }} {{ range .Site.Home.Sections.ByTitle }} {{ template "section-tree-nav" dict "sect" . "currentnode" $currentNode "showvisitedlinks" $showvisitedlinks }} {{ end }} {{ else }} {{ range .Site.Home.Sections.ByWeight }} {{ template "section-tree-nav" dict "sect" . "currentnode" $currentNode "showvisitedlinks" $showvisitedlinks }} {{ end }} {{ end }} {{ define "section-tree-nav" }} {{ $showvisitedlinks := .showvisitedlinks }} {{ $currentNode := .currentnode }} {{ with .sect }} {{if and .IsSection (or (not .Params.hidden) $.showhidden)}} {{safeHTML .Params.head}}
=================================================
some thought, if we can do something support remove more menu, like
L1 ll1 lll1 ll2 lll1 L2 ll2
in ll1-> ll1 page, the sub menu will be
L1 ll1 lll1 ll2 L2 ll2
Not sure if clear to you.
thansk for consider my suggestion!
btw, a new suggestion. when click next page, or input one page in url, can we let the menu move to the corresponding page? How to do it?
Current the menu is a big one to include every thing, it is ok if there is one tutorial in this website, but consider we have 100 tutorials, the big menu will be too big for every single html page. Would you guys consider a new feature to support two level menus? when in main page, show the first level menu, only show tutorial names, no table of contents, when click a tutorial name, show the second level menu, only table of contents of this tutorail, no anything of other tutorails in menu, this will help reduce the size of the pages. please consider this feature. Thanks. I tried to implement this feature, but my hugo and golang is suck, so I come here for help.