From 7f3b4ab8f97cdb1a1a255cb9ccd5d8cc928305bd Mon Sep 17 00:00:00 2001 From: Sebastian Frank Date: Wed, 13 Feb 2019 13:26:49 +0100 Subject: [PATCH] IgnoreForNav --- main.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/main.go b/main.go index 099cec6..846c5bb 100644 --- a/main.go +++ b/main.go @@ -257,6 +257,18 @@ type navElement struct { func buildNavigation(conf *PathConfigTree, curNavMap *map[string]*navElement, curNavSlice *[]*navElement, activeNav string) { 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+"/") subMap := make(map[string]*navElement)