aboutsummaryrefslogtreecommitdiffhomepage
path: root/hugolib/resource_chain_test.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <[email protected]>2020-03-20 16:34:53 +0100
committerBjørn Erik Pedersen <[email protected]>2020-03-20 20:35:57 +0100
commit7204b354a9f46778f068a4712447d6d4fefbefd8 (patch)
treea7d58d64fb9266f5c3f28251cb677b245925e728 /hugolib/resource_chain_test.go
parent574c2959b8d3338764fa1db102a5e0fd6ed322d9 (diff)
downloadhugo-7204b354a9f46778f068a4712447d6d4fefbefd8.tar.gz
hugo-7204b354a9f46778f068a4712447d6d4fefbefd8.zip
Some minify configuration adjustments
Diffstat (limited to 'hugolib/resource_chain_test.go')
-rw-r--r--hugolib/resource_chain_test.go30
1 files changed, 30 insertions, 0 deletions
diff --git a/hugolib/resource_chain_test.go b/hugolib/resource_chain_test.go
index 39279b5bc..8bca6c7b5 100644
--- a/hugolib/resource_chain_test.go
+++ b/hugolib/resource_chain_test.go
@@ -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
+`)
+}