diff --git a/config.toml b/config.toml index cc4608e..4989eb1 100644 --- a/config.toml +++ b/config.toml @@ -4,6 +4,9 @@ title = "MillironX" paginate = 5 theme = "ananke" +[build] + writeStats = true + [Params] cardImage = "saddles" motto = "" diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 92591a9..9ef8a4e 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -10,7 +10,7 @@ {{ $twbscss := resources.Get "node/node_modules/bootstrap/scss/bootstrap.scss" | resources.ToCSS }} {{ $mycss := resources.Get "styles/main.css" }} {{ $allcss := slice $twbscss $mycss | resources.Concat "css/bundle.css" }} - {{ $allcsspure := $allcss | resources.PostCSS | minify | fingerprint | resources.PostProcess }} + {{ $allcsspure := $allcss | resources.PostCSS (dict "nomap" true) | minify | fingerprint | resources.PostProcess }} diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 0000000..faed436 --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,13 @@ +const purgecss = require('@fullhuman/postcss-purgecss')({ + content: ['./hugo_stats.json'], + defaultExtractor: (content) => { + let els = JSON.parse(content).htmlElements; + return els.tags.concat(els.classes, els.ids); + } +}); + +module.exports = { + plugins: [ + purgecss + ] +}