diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2023-05-17 13:12:49 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2023-05-17 22:13:29 +0200 |
commit | 05542130ba0205d3d8d14575b7e49ed42a855b9a (patch) | |
tree | bb94df8ba48b349bdcb18d254af51a38722bef13 /hugolib/config_test.go | |
parent | 5251f015bfff40b49f92f8855834d5682f925860 (diff) |
Handle transient errors in config loading etc.
As in: Get the Kubernetes site to build with the new Hugo version.
Updates #10947
Diffstat (limited to 'hugolib/config_test.go')
-rw-r--r-- | hugolib/config_test.go | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/hugolib/config_test.go b/hugolib/config_test.go index 93060134d..e27068da6 100644 --- a/hugolib/config_test.go +++ b/hugolib/config_test.go @@ -742,6 +742,42 @@ themeconfigdirparam: {{ site.Params.themeconfigdirparam }} } +func TestConfigOutputFormatDefinedInTheme(t *testing.T) { + t.Parallel() + + files := ` +-- hugo.toml -- +theme = "mytheme" +[outputFormats] +[outputFormats.myotherformat] +baseName = 'myotherindex' +mediaType = 'text/html' +[outputs] + home = ['myformat'] +-- themes/mytheme/hugo.toml -- +[outputFormats] +[outputFormats.myformat] +baseName = 'myindex' +mediaType = 'text/html' +-- layouts/index.html -- +Home. + + + +` + + b, err := NewIntegrationTestBuilder( + IntegrationTestConfig{ + T: t, + TxtarString: files, + }, + ).BuildE() + + b.Assert(err, qt.IsNil) + b.AssertFileContent("public/myindex.html", "Home.") + +} + func TestReproCommentsIn10947(t *testing.T) { t.Parallel() @@ -768,7 +804,7 @@ title: "My Swedish Section" --- -- layouts/index.html -- {{ range $i, $e := (slice site .Site) }} -{{ $i }}|AllPages: {{ len .AllPages }}|Sections: {{ if .Sections }}true{{ end }}| Author: {{ .Authors }}|BuildDrafts: {{ .BuildDrafts }}|IsMultiLingual: {{ .IsMultiLingual }}|Param: {{ .Language.Params.myparam }}| +{{ $i }}|AllPages: {{ len .AllPages }}|Sections: {{ if .Sections }}true{{ end }}| Author: {{ .Authors }}|BuildDrafts: {{ .BuildDrafts }}|IsMultiLingual: {{ .IsMultiLingual }}|Param: {{ .Language.Params.myparam }}|Language string: {{ .Language }}|Languages: {{ .Languages }} {{ end }} |