Some minify configuration adjustments

This commit is contained in:
Bjørn Erik Pedersen
2020-03-20 16:34:53 +01:00
parent 574c2959b8
commit 7204b354a9
18 changed files with 173 additions and 143 deletions

View File

@@ -947,3 +947,33 @@ class-in-b {
build("never", true)
}
func TestResourceMinifyDisabled(t *testing.T) {
t.Parallel()
b := newTestSitesBuilder(t).WithConfigFile("toml", `
baseURL = "https://example.org"
[minify]
disableXML=true
`)
b.WithContent("page.md", "")
b.WithSourceFile(
"assets/xml/data.xml", "<root> <foo> asdfasdf </foo> </root>",
)
b.WithTemplates("index.html", `
{{ $xml := resources.Get "xml/data.xml" | minify | fingerprint }}
XML: {{ $xml.Content | safeHTML }}|{{ $xml.RelPermalink }}
`)
b.Build(BuildCfg{})
b.AssertFileContent("public/index.html", `
XML: <root> <foo> asdfasdf </foo> </root>|/xml/data.min.3be4fddd19aaebb18c48dd6645215b822df74701957d6d36e59f203f9c30fd9f.xml
`)
}