From 59bd9656fafa237e1510a6420239a2d0104017fb Mon Sep 17 00:00:00 2001 From: Mark Ayers Date: Sat, 27 Mar 2021 06:36:04 -0400 Subject: [PATCH] Update postprocess.md - make example files clear - remove framework specific configuration from this example - Tailwind CSS users will find many examples elsewhere --- content/en/hugo-pipes/postprocess.md | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/content/en/hugo-pipes/postprocess.md b/content/en/hugo-pipes/postprocess.md index 6fb593950..1f935b3d8 100755 --- a/content/en/hugo-pipes/postprocess.md +++ b/content/en/hugo-pipes/postprocess.md @@ -35,11 +35,15 @@ There are several ways to set up CSS purging with PostCSS in Hugo. If you have a The below configuration will write a `hugo_stats.json` file to the project root as part of the build. If you're only using this for the production build, you should consider placing it below [config/production](/getting-started/configuration/#configuration-directory). +`config.toml` + ```toml [build] writeStats = true ``` +`purgecss.config.js` + ```js const purgecss = require('@fullhuman/postcss-purgecss')({ content: [ './hugo_stats.json' ], @@ -48,14 +52,6 @@ const purgecss = require('@fullhuman/postcss-purgecss')({ return els.tags.concat(els.classes, els.ids); } }); - -module.exports = { - plugins: [ - require('tailwindcss'), - require('autoprefixer'), - ...(process.env.HUGO_ENVIRONMENT === 'production' ? [ purgecss ] : []) - ] -}; ``` Note that in the example above, the "CSS purge step" will only be applied to the production build. This means that you need to do something like this in your head template to build and include your CSS: