cryogen icon indicating copy to clipboard operation
cryogen copied to clipboard

[feature] unique files names

Open kwladyka opened this issue 4 years ago • 1 comments

Unique files names for css / js etc.

For example in Hugo {{- $style := resources.Get "sass/main.scss" | toCSS | minify | fingerprint -}} make from scss file, but named main.min.e56b0f76143debd6df3cb44954ca9b65bf06439fee332c88f655980b7a15b5a7.css instead of "main.css". The hash is used.

This is expected result, but of course it need to be done in Selmer way.

Why? Issues with refresh files in web browser after update.

kwladyka avatar Jun 09 '21 21:06 kwladyka

Hi @kwladyka ! That sounds as a good idea. I guess somewhere around https://github.com/cryogen-project/cryogen-core/blob/8318bde771d39515b5f5a7f5af53ba5c55aeec35/src/cryogen_core/compiler.clj#L663 we could add code that computes the fingerprints, renames the files to include those, and creates a map original name -> fingerprinted name that can then be used from Selmer templates to get the correct file name.

holyjak avatar Oct 05 '21 08:10 holyjak