summaryrefslogtreecommitdiffstats
path: root/hugolib
diff options
context:
space:
mode:
authorNoah Campbell <noahcampbell@gmail.com>2013-09-18 11:52:30 -0700
committerNoah Campbell <noahcampbell@gmail.com>2013-09-18 11:52:30 -0700
commit5374242ff7b6cc1677baf9a1dd2b835d8ee6d18f (patch)
tree4343b2af45326a3343b5d53e14d069b0fcf0bb5f /hugolib
parentc510140c0c55394d5b699c62f60df53ef8a164c7 (diff)
More expressive --check output
Diffstat (limited to 'hugolib')
-rw-r--r--hugolib/planner.go8
-rw-r--r--hugolib/site_show_plan_test.go22
2 files changed, 21 insertions, 9 deletions
diff --git a/hugolib/planner.go b/hugolib/planner.go
index 96962350e..88d5dee7a 100644
--- a/hugolib/planner.go
+++ b/hugolib/planner.go
@@ -14,11 +14,16 @@ func (s *Site) ShowPlan(out io.Writer) (err error) {
fmt.Fprintf(out, "%s", p.FileName)
if p.IsRenderable() {
fmt.Fprintf(out, " (renderer: markdown)")
+ } else {
+ fmt.Fprintf(out, " (renderer: n/a)")
}
+ if s.Tmpl != nil {
+ fmt.Fprintf(out, " (layout: %s, exists: %t)", p.Layout(), s.Tmpl.Lookup(p.Layout()) != nil)
+ }
fmt.Fprintf(out, "\n")
fmt.Fprintf(out, " canonical => ")
if s.Target == nil {
- fmt.Fprintf(out, "%s\n", "!no target specified!")
+ fmt.Fprintf(out, "%s\n\n", "!no target specified!")
continue
}
@@ -39,6 +44,7 @@ func (s *Site) ShowPlan(out io.Writer) (err error) {
}
fmt.Fprintf(out, " %s => %s\n", alias, aliasTrans)
}
+ fmt.Fprintln(out)
}
return
}
diff --git a/hugolib/site_show_plan_test.go b/hugolib/site_show_plan_test.go
index 6d0083e68..2e7e396ed 100644
--- a/hugolib/site_show_plan_test.go
+++ b/hugolib/site_show_plan_test.go
@@ -17,6 +17,7 @@ type byteSource struct {
var fakeSource = []byteSource{
{"foo/bar/file.md", []byte(SIMPLE_PAGE)},
{"alias/test/file1.md", []byte(ALIAS_DOC_1)},
+ {"section/somecontent.html", []byte(RENDER_NO_FRONT_MATTER)},
}
type inMemorySource struct {
@@ -54,8 +55,9 @@ func TestDegenerateNoTarget(t *testing.T) {
Source: &inMemorySource{fakeSource},
}
must(s.CreatePages())
- expected := "foo/bar/file.md (renderer: markdown)\n canonical => !no target specified!\n" +
- "alias/test/file1.md (renderer: markdown)\n canonical => !no target specified!\n"
+ expected := "foo/bar/file.md (renderer: markdown)\n canonical => !no target specified!\n\n" +
+ "alias/test/file1.md (renderer: markdown)\n canonical => !no target specified!\n\n" +
+ "section/somecontent.html (renderer: n/a)\n canonical => !no target specified!\n\n"
checkShowPlanExpected(t, s, expected)
}
@@ -66,11 +68,13 @@ func TestFileTarget(t *testing.T) {
Alias: new(target.HTMLRedirectAlias),
}
must(s.CreatePages())
- expected := "foo/bar/file.md (renderer: markdown)\n canonical => foo/bar/file/index.html\n" +
+ expected := "foo/bar/file.md (renderer: markdown)\n canonical => foo/bar/file/index.html\n\n" +
"alias/test/file1.md (renderer: markdown)\n" +
" canonical => alias/test/file1/index.html\n" +
" alias1/ => alias1/index.html\n" +
- " alias-2/ => alias-2/index.html\n"
+ " alias-2/ => alias-2/index.html\n\n" +
+ "section/somecontent.html (renderer: n/a)\n canonical => section/somecontent/index.html\n\n"
+
checkShowPlanExpected(t, s, expected)
}
@@ -81,11 +85,12 @@ func TestFileTargetUgly(t *testing.T) {
Alias: new(target.HTMLRedirectAlias),
}
s.CreatePages()
- expected := "foo/bar/file.md (renderer: markdown)\n canonical => foo/bar/file.html\n" +
+ expected := "foo/bar/file.md (renderer: markdown)\n canonical => foo/bar/file.html\n\n" +
"alias/test/file1.md (renderer: markdown)\n" +
" canonical => alias/test/file1.html\n" +
" alias1/ => alias1/index.html\n" +
- " alias-2/ => alias-2/index.html\n"
+ " alias-2/ => alias-2/index.html\n\n" +
+ "section/somecontent.html (renderer: n/a)\n canonical => section/somecontent.html\n\n"
checkShowPlanExpected(t, s, expected)
}
@@ -97,10 +102,11 @@ func TestFileTargetPublishDir(t *testing.T) {
}
must(s.CreatePages())
- expected := "foo/bar/file.md (renderer: markdown)\n canonical => ../public/foo/bar/file/index.html\n" +
+ expected := "foo/bar/file.md (renderer: markdown)\n canonical => ../public/foo/bar/file/index.html\n\n" +
"alias/test/file1.md (renderer: markdown)\n" +
" canonical => ../public/alias/test/file1/index.html\n" +
" alias1/ => ../public/alias1/index.html\n" +
- " alias-2/ => ../public/alias-2/index.html\n"
+ " alias-2/ => ../public/alias-2/index.html\n\n" +
+ "section/somecontent.html (renderer: n/a)\n canonical => ../public/section/somecontent/index.html\n\n"
checkShowPlanExpected(t, s, expected)
}