IgnoreForNav
This commit is contained in:
parent
01fa98b28c
commit
7f3b4ab8f9
12
main.go
12
main.go
@ -257,6 +257,18 @@ type navElement struct {
|
|||||||
|
|
||||||
func buildNavigation(conf *PathConfigTree, curNavMap *map[string]*navElement, curNavSlice *[]*navElement, activeNav string) {
|
func buildNavigation(conf *PathConfigTree, curNavMap *map[string]*navElement, curNavSlice *[]*navElement, activeNav string) {
|
||||||
for _, el := range conf.Sub {
|
for _, el := range conf.Sub {
|
||||||
|
ignNav := el.Config.Path.IgnoreForNav
|
||||||
|
if ignNav != nil && *ignNav != "" {
|
||||||
|
regex, err := regexp.Compile(*ignNav)
|
||||||
|
if err != nil {
|
||||||
|
log.Panicf("could not compile IngoreForNav regexp '%s' in '%s': %s", *ignNav, el.InputPath, err)
|
||||||
|
}
|
||||||
|
if regex.MatchString(path.Base(el.InputPath)) {
|
||||||
|
log.Noticef("ignoring input directory '%s' in navigation", el.InputPath)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
elPath := strings.TrimPrefix(el.OutputPath, *outDir+"/")
|
elPath := strings.TrimPrefix(el.OutputPath, *outDir+"/")
|
||||||
|
|
||||||
subMap := make(map[string]*navElement)
|
subMap := make(map[string]*navElement)
|
||||||
|
Loading…
Reference in New Issue
Block a user