Compare commits
2
Commits
e1183ee316
...
968c50e3e2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
968c50e3e2 | ||
|
|
e950515960 |
@@ -58,4 +58,13 @@ func TestDoc(t *testing.T) {
|
||||
if len(c) != 1 {
|
||||
t.Fatalf("expected 1 page, but saw %d pages", len(c))
|
||||
}
|
||||
|
||||
w.CH.NewContent("TEST 2!!", "")
|
||||
c, err = GetContent(w.BlogFolder, w.CH.HugoSites)
|
||||
if err != nil {
|
||||
t.Fatalf("couldn't get content from the test environment: %v", err)
|
||||
}
|
||||
if len(c) != 2 {
|
||||
t.Fatalf("expected 2 pages, but saw %d pages", len(c))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
"github.com/g3n/engine/gui/assets"
|
||||
"git.stephensearles.com/stephen/caddy-hugo2/assets"
|
||||
"github.com/mholt/caddy"
|
||||
"github.com/mholt/caddy/caddyhttp/httpserver"
|
||||
)
|
||||
|
||||
@@ -16,8 +16,9 @@ import (
|
||||
|
||||
func (ch *CaddyHugo) SetupCaddy(c *caddy.Controller) error {
|
||||
ch.Site = httpserver.GetConfig(c)
|
||||
err := ch.Setup(ch.Site.Root)
|
||||
ch.Site.AddMiddleware(ch.Middleware(c))
|
||||
return ch.Setup(ch.Dir)
|
||||
return err
|
||||
}
|
||||
|
||||
func (ch *CaddyHugo) Setup(dir string) error {
|
||||
@@ -74,5 +75,10 @@ func (ch *CaddyHugo) Setup(dir string) error {
|
||||
return fmt.Errorf("couldn't initialize media: %v", err)
|
||||
}
|
||||
|
||||
return ch.Publish()
|
||||
err = ch.Publish()
|
||||
if err != nil {
|
||||
fmt.Println("error with initial publish of hugo site:", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user