eudicots / Cactus

Static site generator for designers. Uses Python and Django templates.
BSD 3-Clause "New" or "Revised" License
3.46k stars 314 forks source link

Fingerprinted files are not removed on build #222

Closed ghost closed 8 years ago

ghost commented 8 years ago

Building or serving a site with fingerprinting enabled for css and js files leads to a growing number of css and js files.

Each time a css or js file gets edited it gets added to the build folder with a new fingerprint, which is fine. But the old files are also kept in the build folder.

I'd expected to see some kind of "compare fingerprint and if it differs replace the file" behavior. Or at least always replace the fingerprinted files wether they were edited or not...

krallin commented 8 years ago

In this case it might make sense just to clean out your .build directory. is that problematic for you?

Not sure I understood your last sentence about replacing the fingerprinted files. Let me know if you can clarify.

Cheers,

ghost commented 8 years ago

Cleaning the .build directory would make sense. Where would I need to add the remove code?

Regarding the last sentences: I expected only the files that changed get overwritten on build, not all of them (coming from HUGO I was used to this). Just noticed every file gets rewritten on build. Thats fine, I just need to get rid of the not needed files for my automated deploying.

ghost commented 8 years ago

I just added site.clean() to the build function in the cli.py for now...

ghost commented 8 years ago

@dennisblume thanks for the plugin. Much cleaner solution! Hacking the core was really just a quick fix...