summaryrefslogtreecommitdiffstats
path: root/hugolib/site_test.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2017-04-07 13:03:34 +0200
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2017-04-07 13:03:34 +0200
commit7ad721fd78b473ae7d9b05418bb029c51d1d9251 (patch)
tree3a36c6e3ec674dc34eea367a98d7240f41304732 /hugolib/site_test.go
parent5714531f34469234035323bc9e1cc9de33a8f839 (diff)
hugolib: Add .Site.Params.mainSections
Fixes #3206
Diffstat (limited to 'hugolib/site_test.go')
-rw-r--r--hugolib/site_test.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/hugolib/site_test.go b/hugolib/site_test.go
index e00e8b230..e18456bf9 100644
--- a/hugolib/site_test.go
+++ b/hugolib/site_test.go
@@ -400,6 +400,8 @@ func doTestSectionNaming(t *testing.T, canonify, uglify, pluralize bool) {
sources := []source.ByteSource{
{Name: filepath.FromSlash("sect/doc1.html"), Content: []byte("doc1")},
+ // Add one more page to sect to make sure sect is picked in mainSections
+ {Name: filepath.FromSlash("sect/sect.html"), Content: []byte("sect")},
{Name: filepath.FromSlash("Fish and Chips/doc2.html"), Content: []byte("doc2")},
{Name: filepath.FromSlash("ラーメン/doc3.html"), Content: []byte("doc3")},
}
@@ -419,6 +421,11 @@ func doTestSectionNaming(t *testing.T, canonify, uglify, pluralize bool) {
writeSource(t, fs, filepath.Join("layouts", "_default/list.html"), "{{.Title}}")
s := buildSingleSite(t, deps.DepsCfg{Fs: fs, Cfg: cfg}, BuildCfg{})
+
+ mainSections, err := s.Info.Param("mainSections")
+ require.NoError(t, err)
+ require.Equal(t, mainSections, []string{"sect"})
+
th := testHelper{s.Cfg, s.Fs, t}
tests := []struct {
doc string