mirror of
https://github.com/gohugoio/hugo.git
synced 2024-05-11 05:54:58 +00:00
Introduce HugoSites type
And a Hugo global variable which contains the site under build. This is really needed to get some level of control of the "multiple languages" in play. There are still work related to this scattered around, but that will come. With this commit, the multilingual feature is starting to work.
This commit is contained in:
@@ -226,7 +226,7 @@ func doTestPaginator(t *testing.T, useViper bool) {
|
||||
viper.Set("paginate", -1)
|
||||
}
|
||||
pages := createTestPages(12)
|
||||
s := &Site{}
|
||||
s := newSiteDefaultLang()
|
||||
n1 := s.newHomeNode()
|
||||
n2 := s.newHomeNode()
|
||||
n1.Data["Pages"] = pages
|
||||
@@ -264,7 +264,7 @@ func TestPaginatorWithNegativePaginate(t *testing.T) {
|
||||
defer viper.Reset()
|
||||
|
||||
viper.Set("paginate", -1)
|
||||
s := &Site{}
|
||||
s := newSiteDefaultLang()
|
||||
_, err := s.newHomeNode().Paginator()
|
||||
assert.NotNil(t, err)
|
||||
}
|
||||
@@ -287,7 +287,7 @@ func doTestPaginate(t *testing.T, useViper bool) {
|
||||
}
|
||||
|
||||
pages := createTestPages(6)
|
||||
s := &Site{}
|
||||
s := newSiteDefaultLang()
|
||||
n1 := s.newHomeNode()
|
||||
n2 := s.newHomeNode()
|
||||
|
||||
@@ -320,7 +320,7 @@ func doTestPaginate(t *testing.T, useViper bool) {
|
||||
}
|
||||
|
||||
func TestInvalidOptions(t *testing.T) {
|
||||
s := &Site{}
|
||||
s := newSiteDefaultLang()
|
||||
n1 := s.newHomeNode()
|
||||
_, err := n1.Paginate(createTestPages(1), 1, 2)
|
||||
assert.NotNil(t, err)
|
||||
@@ -335,7 +335,7 @@ func TestPaginateWithNegativePaginate(t *testing.T) {
|
||||
defer viper.Reset()
|
||||
|
||||
viper.Set("paginate", -1)
|
||||
s := &Site{}
|
||||
s := newSiteDefaultLang()
|
||||
_, err := s.newHomeNode().Paginate(createTestPages(2))
|
||||
assert.NotNil(t, err)
|
||||
}
|
||||
@@ -358,7 +358,7 @@ func TestPaginatorFollowedByPaginateShouldFail(t *testing.T) {
|
||||
defer viper.Reset()
|
||||
|
||||
viper.Set("paginate", 10)
|
||||
s := &Site{}
|
||||
s := newSiteDefaultLang()
|
||||
n1 := s.newHomeNode()
|
||||
n2 := s.newHomeNode()
|
||||
|
||||
@@ -377,7 +377,7 @@ func TestPaginateFollowedByDifferentPaginateShouldFail(t *testing.T) {
|
||||
defer viper.Reset()
|
||||
|
||||
viper.Set("paginate", 10)
|
||||
s := &Site{}
|
||||
s := newSiteDefaultLang()
|
||||
n1 := s.newHomeNode()
|
||||
n2 := s.newHomeNode()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user