-
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add ability to enable/disable at site level #10
Comments
What about using Hugo's built-in caching? See also https://gohugo.io/getting-started/configuration/#configure-file-caches and https://gohugo.io/content-management/image-processing/#image-processing-performance-consideration |
Thanks for the reply. I'm not overriding any default cache settings, except the one that came with Hyas:
With the disabling method mentioned above, I still see the width warning on each build for images processed through the shortcode. Is there some custom cache setting that I need that I'm missing? |
This should do: [caches]
[caches.assets]
dir = ':resourceDir/_gen'
maxAge = -1
[caches.images]
dir = ':resourceDir/_gen'
maxAge = -1
Is the width of these images below the smallest width: image:
## General
type: page # page (default) or global
widths: [480, 640, 768, 1024, 1366] # [600, 900, 1300] (default)
[..] Or, are you using custom widths — see e.g. https://github.com/future-wd/hugo-responsive-images#shortcode---cropping-an-image-to-an-aspect-ratio-custom-respnsive-widths |
I'm not using custom widths. Yes, some images have widths below the smallest width specified for processing, hence the warning messages. But I still get the warning messages even after adding these Also, these cache settings are the hugo default... As far as I understand, that means they will only have any impact if set to any other values, right? |
Images 3.0 improves image generation time — significantly — thanks to using better templates Note that, images are only rebuilding when you run for example: npm run clean:build && npm run dev For production, see Image processing performance consideration |
Summary
Add ability to enable/disable all Hyas images-based image processing at the site level in config.
Basic example
Ideally, via a param in
hugo.toml
, such ashyas_images = false
for local development, which can be overridden totrue
inproduction/config.toml
.Motivation
I have a site with thousands of images. Using Hyas images image processing in single, list, partial templates, and shortcodes increases build times significantly, making local development much more difficult and time consuming. I have created a custom site-level param to achieve this functionality, and simply reference it in my templates as follows:
This works fine in templates, but it doesn't work with Hyas images processed through shortcodes. This approach also requires a lot of extra coding, as I have many templates this logic needs to be added to.
Built-in site-level enable/disable would be so much better for cases like this.
The text was updated successfully, but these errors were encountered: