Active NavElement

This commit is contained in:
Sebastian Frank
2019-02-13 13:14:16 +01:00
parent 39769a89c0
commit 01fa98b28c
5 changed files with 27 additions and 7 deletions

View File

@@ -249,6 +249,7 @@ func readContentDir(inBase string, outBase string, dir string, conf *PathConfig,
type navElement struct {
Navname string
GoTo string
Active bool
SubMap *map[string]*navElement
SubSlice *[]*navElement
@@ -256,13 +257,15 @@ type navElement struct {
func buildNavigation(conf *PathConfigTree, curNavMap *map[string]*navElement, curNavSlice *[]*navElement, activeNav string) {
for _, el := range conf.Sub {
elPath := strings.TrimPrefix(el.OutputPath, *outDir+"/")
subMap := make(map[string]*navElement)
subSlice := make([]*navElement, 0)
navEl := navElement{
Active: strings.HasPrefix(activeNav, elPath),
SubMap: &subMap,
SubSlice: &subSlice,
}
elPath := strings.TrimPrefix(el.OutputPath, *outDir+"/")
n := el.Config.This.Navname
if n != nil {