Active NavElement
This commit is contained in:
5
main.go
5
main.go
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user