From 7204b354a9f46778f068a4712447d6d4fefbefd8 Mon Sep 17 00:00:00 2001 From: Bjørn Erik Pedersen Date: Fri, 20 Mar 2020 16:34:53 +0100 Subject: Some minify configuration adjustments --- hugolib/resource_chain_test.go | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'hugolib/resource_chain_test.go') 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", " asdfasdf ", + ) + + 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: asdfasdf |/xml/data.min.3be4fddd19aaebb18c48dd6645215b822df74701957d6d36e59f203f9c30fd9f.xml +`) +} -- cgit v1.2.3