This commit is contained in:
15
main.go
15
main.go
@@ -12,6 +12,7 @@ import (
|
||||
|
||||
"github.com/davecgh/go-spew/spew"
|
||||
"github.com/flosch/pongo2"
|
||||
"github.com/gosimple/slug"
|
||||
"github.com/op/go-logging"
|
||||
cpy "github.com/otiai10/copy"
|
||||
"gopkg.in/russross/blackfriday.v2"
|
||||
@@ -155,19 +156,19 @@ func readContentDir(inBase string, outBase string, dir string, conf *PathConfig,
|
||||
stripedDir = regex.ReplaceAllString(stripedDir, "$1")
|
||||
}
|
||||
}
|
||||
regex := regexp.MustCompile("[^a-zA-Z]")
|
||||
stripedDir = regex.ReplaceAllString(stripedDir, "_")
|
||||
outPath := outBase + "/" + stripedDir
|
||||
outPath = path.Clean(outPath)
|
||||
|
||||
log.Infof("calculated output directory: %s", outPath)
|
||||
tree.OutputPath = outPath
|
||||
|
||||
if tree.Config.This.Navname == nil {
|
||||
navname := strings.Replace(stripedDir, "_", " ", -1)
|
||||
tree.Config.This.Navname = &navname
|
||||
}
|
||||
|
||||
stripedDir = slug.Make(stripedDir)
|
||||
outPath := outBase + "/" + stripedDir
|
||||
outPath = path.Clean(outPath)
|
||||
|
||||
log.Infof("calculated output directory: %s", outPath)
|
||||
tree.OutputPath = outPath
|
||||
|
||||
// first only files
|
||||
for _, f := range files {
|
||||
p := inPath + "/" + f.Name()
|
||||
|
||||
Reference in New Issue
Block a user