This commit is contained in:
parent
1d3facc319
commit
1fecb5faae
6
.gitmodules
vendored
6
.gitmodules
vendored
@ -40,3 +40,9 @@
|
||||
[submodule "vendor/github.com/juju/errors"]
|
||||
path = vendor/github.com/juju/errors
|
||||
url = https://github.com/juju/errors
|
||||
[submodule "vendor/github.com/gosimple/slug"]
|
||||
path = vendor/github.com/gosimple/slug
|
||||
url = https://github.com/gosimple/slug
|
||||
[submodule "vendor/github.com/rainycape/unidecode"]
|
||||
path = vendor/github.com/rainycape/unidecode
|
||||
url = https://github.com/rainycape/unidecode
|
||||
|
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 33 KiB |
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()
|
||||
|
1
vendor/github.com/gosimple/slug
generated
vendored
Submodule
1
vendor/github.com/gosimple/slug
generated
vendored
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit 42ac18c34c2c6f4843fa48167317dcaa9416d1e2
|
1
vendor/github.com/rainycape/unidecode
generated
vendored
Submodule
1
vendor/github.com/rainycape/unidecode
generated
vendored
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit cb7f23ec59bec0d61b19c56cd88cee3d0cc1870c
|
Loading…
Reference in New Issue
Block a user