Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gohugoio/hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2020-03-20 18:34:53 +0300
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2020-03-20 22:35:57 +0300
commit7204b354a9f46778f068a4712447d6d4fefbefd8 (patch)
treea7d58d64fb9266f5c3f28251cb677b245925e728 /hugolib
parent574c2959b8d3338764fa1db102a5e0fd6ed322d9 (diff)
Some minify configuration adjustments
Diffstat (limited to 'hugolib')
-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
+`)
+}