Purge or remove unused css

Not sure if this feature is build in or not yet. I tried to find the zola cli option but didn’t see.

will try this if zola doesn’t have it built-in.

Thanks.

I’m happy to add that if there is such a tool written in Rust. We can’t bundle NodeJS tools but you can definitely have a post-build step with something like purgecss

1 Like

@keats There are two rust crates that may be of interest here:

https://docs.rs/css-purify/0.0.15/css_purify/
https://docs.rs/css-autoprefix/0.0.5/css_autoprefix/

I am new to rust and would like to create PRs for these if you are interested.

I’m pretty sure you don’t need to prefix anymore for most things (stuff like grid is hard GitHub - postcss/autoprefixer: Parse CSS and add vendor prefixes to rules by Can I Use) if you don’t need to support IE11.

As for css_purify, it doesn’t seem like a crate that can be used (no docs, 0.1, no commits in the last 4 years).
I would recommend to have a post-processing step with node instead since the tools are way more mature there.