diff --git a/config.yaml b/config.yaml index 2ae04fab..7f423a00 100644 --- a/config.yaml +++ b/config.yaml @@ -4,7 +4,10 @@ copyright: Dave Gallant title: davegallant.ca enableGitInfo: true enableRobotsTXT: true -noJSConfigInAssets: true + +build: + noJSConfigInAssets: true + writeStats: true params: author: Dave Gallant diff --git a/themes/hugo-theme-gruvbox/postcss.config.js b/themes/hugo-theme-gruvbox/postcss.config.js index 95389a8b..4a1c68bf 100644 --- a/themes/hugo-theme-gruvbox/postcss.config.js +++ b/themes/hugo-theme-gruvbox/postcss.config.js @@ -25,6 +25,14 @@ module.exports = () => ({ ? [ require("postcss-preset-env"), require("cssnano"), + require("@fullhuman/postcss-purgecss")({ + content: ["./hugo_stats.json"], + defaultExtractor: (content) => { + let els = JSON.parse(content).htmlElements; + return els.tags.concat(els.classes, els.ids); + }, + safelist: ["data-theme"], + }), ] : []), ],