Skip to content
This repository has been archived by the owner on Jun 16, 2022. It is now read-only.

Keep reference to original file name in compressed file name #77

Open
victorkristof opened this issue Sep 24, 2020 · 2 comments
Open

Keep reference to original file name in compressed file name #77

victorkristof opened this issue Sep 24, 2020 · 2 comments

Comments

@victorkristof
Copy link

Hi there,

Thanks for the great library!

I was wondering whether we could add an option to keep a reference to the original file name in the compressed file name?

For example, if I have a custom.css and wrap it around a {% compress 'css' %} block, the new file name will be something like 5ef7a08e1b4dfe00216375aa6b9ecc0d.css.

I would love to have it transformed into something like custom.5ef7a08e1b4dfe00216375aa6b9ecc0d.css, so that I know that this file is a compression of custom.css.

Thanks!

@jaysonsantos
Copy link
Owner

Hey there, thanks for your report.
I guess it would be possible by having a second argument on compress like {% compress 'css' 'name-of-the-final-file' %} because inside the block there can be many link, css and, script blocks and it would hard to guess a name there.
What do you think?

@victorkristof
Copy link
Author

victorkristof commented Sep 30, 2020

Hi Jayson,

I didn't think of the case of compressing multiple files in one, but you're right! And that's a good idea.

So writing {% compress 'css' 'my-stylesheets' %} would generate a file called my-stylesheets.{hash}.css. And it would work for compressing one or more files in one.I like it :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants