mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-22 21:42:50 +02:00
Export Page.Layout
And at the same time rename and unexport the badly named `Layout()` func. That method is not very usable outside the package. Fixes #1539
This commit is contained in:
@@ -502,8 +502,8 @@ func checkPageType(t *testing.T, page *Page, pageType string) {
|
||||
}
|
||||
|
||||
func checkPageLayout(t *testing.T, page *Page, layout ...string) {
|
||||
if !listEqual(page.Layout(), layout) {
|
||||
t.Fatalf("Page layout is: %s. Expected: %s", page.Layout(), layout)
|
||||
if !listEqual(page.layouts(), layout) {
|
||||
t.Fatalf("Page layout is: %s. Expected: %s", page.layouts(), layout)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -909,8 +909,8 @@ func TestLayoutOverride(t *testing.T) {
|
||||
for _, y := range test.expectedLayout {
|
||||
test.expectedLayout = append(test.expectedLayout, "theme/"+y)
|
||||
}
|
||||
if !listEqual(p.Layout(), test.expectedLayout) {
|
||||
t.Errorf("Layout mismatch. Expected: %s, got: %s", test.expectedLayout, p.Layout())
|
||||
if !listEqual(p.layouts(), test.expectedLayout) {
|
||||
t.Errorf("Layout mismatch. Expected: %s, got: %s", test.expectedLayout, p.layouts())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user