-
-
Notifications
You must be signed in to change notification settings - Fork 7.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow global ignore of some resource trans. methods per environment. #4981
Comments
Hmm... I guess we at some point will add some "site config globals" for the different transformations (SCSS etc.), but t.this was not what I had in mind. What I really like with all of this is the what you see is what you get. Without having to hunt down some nested config in some XML files to debug why fingerprinting suddenly stopped working. |
What XML file? I'm talking about a project only configuration parameter (you make a point, themes should not be able to set it). Let me push my point a bit here. Currently an
Lastly, I would add that this fingerprinting on/off switch per environment is almost systematic among Gulp|Grunt|Webpack users and would be a welcome addition to their Hugo built-in counterpart: Hugo Pipes. |
I was talking about the "Gulp XML files", not Hugo. You can use some other flag than IsServer which would solve most of your concerns. What you want is doable, of course, but I'm not totally convinced. This will look prettier once Go 1.11 is out and we can re-assign variables, and the "one-liner" is only beautiful if I can look at it and tell exactly what it does. |
... but this isn't set in stone, but I feel that this need to linger a little... |
Sure some users may spend some time wondering why their assets are not fingerprinted, but I don't think we should worry about the tribulations of people not aware of their project's configuration settings. They'll find the problem, slap their forehead and quietly move on. Like I always do when being clueless with my I think a global, per environment fingerprinting / minifying is something people will want to deal with easily and with the minimum template files editing involved. I am not sure the current
Of course. |
I build this kind of partials which systematically needs
And start daydreaming about this issue :) |
This issue has been automatically marked as stale because it has not had recent activity. The resources of the Hugo team are limited, and so we are asking for your help. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
It is good practice to test
.IsServer
before applyingresource.Minify
andresources.Fingerprint
to a resource.Systematically calling a condition for each resource processed may become very tedious when you start using Hugo Pipes's asset transform (ex image process) in a lot of different location in your templates or when most of your templates are inherited from a theme.
I'm proposing (more like enquiring for feasibility) an alternative: To add a new config setting allowing the ignoring of certain asset transformation methods. This way we can safely
.Fingerprint
and/or.Whatever
our assets without having to test the environement.The text was updated successfully, but these errors were encountered: