mirror of
https://github.com/gohugoio/hugo.git
synced 2026-08-24 07:18:54 +00:00
output: Add TestCanonical integration test
This commit is contained in:
@@ -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: /.")
|
||||
}
|
||||
Reference in New Issue
Block a user