From b5475f0574eecd30a8c5856608673a6aa9d9d182 Mon Sep 17 00:00:00 2001 From: John Bowdre Date: Mon, 15 Jan 2024 13:53:52 -0600 Subject: [PATCH] rss: don't minify whitespace in xml --- config/_default/hugo.toml | 27 +++++++++++++++++++++++++++ layouts/_default/rss.xml | 2 +- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/config/_default/hugo.toml b/config/_default/hugo.toml index c6155e5..ef02686 100644 --- a/config/_default/hugo.toml +++ b/config/_default/hugo.toml @@ -60,3 +60,30 @@ enableInlineShortcodes = true tag = "tags" series = "series" +# Copied from https://gohugo.io/getting-started/configuration/#configure-minify +# Only change made is xml keepWhitespace = true +[minify] + disableCSS = false + disableHTML = false + disableJS = false + disableJSON = false + disableSVG = false + disableXML = false + minifyOutput = false + [minify.tdewolff] + [minify.tdewolff.css] + decimals = -1 + keepCSS2 = true + [minify.tdewolff.html] + keepConditionalComments = true + keepDefaultAttrVals = true + keepDocumentTags = true + keepEndTags = true + keepQuotes = false + keepWhitespace = false + [minify.tdewolff.js] + [minify.tdewolff.json] + [minify.tdewolff.svg] + decimals = -1 + [minify.tdewolff.xml] + keepWhitespace = true \ No newline at end of file diff --git a/layouts/_default/rss.xml b/layouts/_default/rss.xml index e1f9961..198a490 100644 --- a/layouts/_default/rss.xml +++ b/layouts/_default/rss.xml @@ -10,7 +10,7 @@ {{- if ge $limit 1 -}} {{- $pages = $pages | first $limit -}} {{- end -}} - +{{- printf "" | safeHTML }}