From: Bjørn Erik Pedersen Date: Tue, 13 Jan 2026 15:36:34 +0000 (+0100) Subject: output: Add TestCanonical integration test X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=2bc54df622f4fa8c2bc94233827fb440a8f75ece;p=brevno-suite%2Fhugo output: Add TestCanonical integration test --- diff --git a/output/outputFormat_integration_test.go b/output/outputFormat_integration_test.go new file mode 100644 index 000000000..161ecd9ab --- /dev/null +++ b/output/outputFormat_integration_test.go @@ -0,0 +1,30 @@ +package output_test + +import ( + "testing" + + "github.com/gohugoio/hugo/hugolib" +) + +func TestCanonical(t *testing.T) { + t.Parallel() + + files := ` +-- hugo.toml -- +[outputs] + home = ["notcanonical", "html", "rss"] + +[outputFormats] +[outputFormats.notcanonical] +mediaType = 'text/html' +path = 'not' +isHTML = true +-- layouts/all.html -- +All. Canonical: {{ .OutputFormats.Canonical.RelPermalink }}. +` + + b := hugolib.Test(t, files) + + b.AssertFileContent("public/not/index.html", "All. Canonical: /.") + b.AssertFileContent("public/index.html", "All. Canonical: /.") +}