Browse Source

fixing setup bug, adding test

pull/8/head
Stephen Searles 2 years ago
parent
commit
e950515960
2 changed files with 11 additions and 1 deletions
  1. 9
    0
      doc_test.go
  2. 2
    1
      setup.go

+ 9
- 0
doc_test.go View File

@@ -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))
}
}

+ 2
- 1
setup.go View File

@@ -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 {

Loading…
Cancel
Save