Newsletter
Join the Community
Subscribe to our newsletter for the latest news and updates
A working Hugo starter that compiles TailwindCSS through PostCSS and PurgeCSS to produce minified, purged CSS.

A full-stack Next.js TypeScript template focused on functionality over UI, featuring Zustand, TanStack Query, and ESLint 9 support.
This Hugo starter template demonstrates how to wire Hugo Pipes to TailwindCSS with PurgeCSS for production-ready, minified CSS output. It's a working example repository, not a full site theme, that shows the minimal file structure and configuration needed to compile TailwindCSS through PostCSS inside Hugo's asset pipeline.
This is a boilerplate repository that pairs Hugo's Pipes asset processing with TailwindCSS, PostCSS, and PurgeCSS. It takes TailwindCSS source files as input and produces a purged, minified CSS bundle during the Hugo build. The repository is maintained as a working example, so you can copy its configuration into your own Hugo site. The critical configuration lives in /assets/css/postcss.config.js for production and /assets/css/dev/postcss.config.js for development.
/assets/css/dev/postcss.config.js skips PurgeCSS to keep rebuilds fast while editing templates./assets/css/postcss.config.js runs PurgeCSS to strip unused TailwindCSS utility classes and AutoPrefixer to add vendor prefixes, with PostCSS-Import inlining imported CSS files.hugo --gc deployment step — The README instructs you to run hugo --gc before deploying to generate the minified, purged CSS file.resources folder into your repository so Hugo doesn't regenerate assets unnecessarily on CI or deployment.content configuration must be updated with the file paths of any themes you add, so classes used in theme templates are not stripped.resources directory and runs hugo --gc before pushing to production.content file list for themes — that prevent empty templates or missing theme paths from breaking the build.Hugo Pipes reads your TailwindCSS entry file and passes it through PostCSS, which runs PostCSS-Import, a custom TailwindCSS extractor, AutoPrefixer, and — in production — PurgeCSS. Because Hugo only rebuilds CSS when the CSS file itself changes, the repo provides two config files: one for development that skips PurgeCSS, and one for production that runs it. Before deploying, run hugo --gc to produce the final purged, minified stylesheet, and commit the generated resources folder so builds stay deterministic.
Hugo Pipes only regenerates assets when the source file changes, not when templates change. In a TailwindCSS setup most of your work happens in templates, which is why this repo provides a separate development PostCSS config without PurgeCSS — so you can edit templates and see changes without waiting for a full purge. Run hugo --gc before deployment to force a production build.
PurgeCSS scans your templates for class names, but TailwindCSS supports class variants and dynamic construction that the default extractor can miss. The custom extractor included in this repo ensures PurgeCSS detects all classes that Tailwind generates, including ones that appear in partials or are built from strings.
PurgeCSS will fail if any of your templates are empty. This is a known limitation stated in the repository notes. You should either remove empty template files or ensure they contain at least some markup so PurgeCSS can parse them without error.
Yes. The repo notes say that when you add themes, you must add the theme's file location to the PurgeCSS content configuration item. If you don't, PurgeCSS will strip utility classes that your theme templates actually use.