CSS file with fingerprting - auto remove unused css files

Hi,

CSS fingerprinting adds some string of characters to the file name. Each time website is deployed, new css file is generated with fingerprint part in the name. After few deployments I see I have bunch CSS files that are not in use anymore.

Is there any way to automatically remove older CSS file?

The fingerprinting is stable, so the above means that the CSS file has changed. Removal of deleted files needs to be done by your deployment process (which you say nothing about).

But, if you had used hugo deploy, this should work:

rm -rf public && hugo && hugo deploy