1
This commit is contained in:
Alex Yatskov 2018-01-08 13:35:02 -08:00
parent 1acd184562
commit 9f2737cb96
2 changed files with 8 additions and 3 deletions

View File

@ -1,6 +1,7 @@
package main
import (
"flag"
"log"
"github.com/FooSoft/goldsmith"
@ -25,5 +26,7 @@ func (b *builder) Build(srcDir, dstDir string) {
}
func main() {
devserver.DevServe(new(builder), 8080, "src", "dst", "layouts")
port := flag.Int("port", 8080, "server port")
flag.Parse()
devserver.DevServe(new(builder), *port, "src", "dst", "layouts")
}

View File

@ -28,10 +28,10 @@ import (
"github.com/FooSoft/goldsmith"
"github.com/FooSoft/goldsmith-components/devserver"
"github.com/FooSoft/goldsmith-components/filters/condition"
"github.com/FooSoft/goldsmith-components/plugins/abs"
"github.com/FooSoft/goldsmith-components/plugins/breadcrumbs"
"github.com/FooSoft/goldsmith-components/plugins/collection"
"github.com/FooSoft/goldsmith-components/plugins/condition"
"github.com/FooSoft/goldsmith-components/plugins/dom"
"github.com/FooSoft/goldsmith-components/plugins/frontmatter"
"github.com/FooSoft/goldsmith-components/plugins/index"
@ -85,7 +85,9 @@ func (b *builder) Build(srcDir, dstDir string) {
Chain(syntax.New().Placement(syntax.PlaceInline)).
Chain(dom.New(fixup)).
Chain(thumbnail.New()).
Chain(condition.If(len(b.root) > 0, abs.New().BaseUrl(b.root))).
FilterPush(condition.If(len(b.root) > 0)).
Chain(abs.New().BaseUrl(b.root)).
FilterPop().
End(dstDir)
for _, err := range errs {