Feature Request: .SecondSection - function addition to .FirstSection

Is it good idea to have such function (not nesessarily callsed .SecondLevel, could be function with “level” parameter)?

I am developing navigation bar for a book having about 800 pages; existing theme “hbstack” which I use depends on .FirstLevel function; generated navigation bar will have (part of a webpage) will have 800 “href” elements. If we have function, “getLevel(2)” for example, we can show “subtree of level 2 up from the current node”.

Please see also discussion at Idea: ".SecondSection" · Issue #860 · hbstack/docs · GitHub

layouts/_default/single.html

Home page title: {{ (index .Ancestors.Reverse 0).Title }}
First section title: {{ (index .Ancestors.Reverse 1).Title }}
Second section title: {{ (index .Ancestors.Reverse 2).Title }}
Third section title: {{ (index .Ancestors.Reverse 3).Title }}
4 Likes

yes I think what I asked is too much for Hugo “core” :wink: thanks for quick response!