bep / hugo-starter-tailwind-basic

A basic and simple to set up Hugo with TailwindCSS starter project.
https://lucid-nightingale-60a4e2.netlify.app/
MIT License
144 stars 32 forks source link

Add layouts to PurgeCSS content #6

Closed regisphilibert closed 3 years ago

regisphilibert commented 3 years ago

The purpose of this PR is to also include the basic "template crawling" in PurgeCSS on top of hugo_stats.json.

In order to gain on build time on CI, (netlify etc...) useResourceCacheWhen: always is set. CI will trigger a build when content is changed by editor and use cached resources. But classes might be added by editors actions (addition of a rarely used banner, change in layout type etc...). Unique TW CSS classes printed by those changes won't be included in cached CSS file used on latest build.

User can comment out './layouts/*/.html' if not needed.