Hugo Image Processing and Build Time on Netlify (reduction by pre-processing)

Hello All,

I am putting Hugo Image Processing function into my site.
As some of my posts have a significant amount of images to be processed this resulting in an increase of build time from seconds to minutes which is obvious.

When I running Hugo in development mode my images are generated in `resources/_gen/images’.

Currently, this folder is in .gitignore but thinking, is if I will process it into Git repo when Netlify will start building and see that there is the above folder does it omit to regenerate them again? If yes, this will reduce a significant amount of time and resources to build sites.

That will be my goal to include this folder into my Git if it will work as above.
On local development when images are generated on another run Hugo already sees them hence not regenerating them again unnecessary.

Would like to confirm before processing.

  Pages            | 2800  
  Paginator pages  |  185  
  Non-page files   |  973  
  Static files     |   25  
  Processed images | 3039  
  Aliases          | 1303  
  Sitemaps         |    1  
  Cleaned          |    0  

Hi @idarek!

Your assumptions are correct!
You have to add the output folder to git (with all the processed images in them) then the Hugo Image processing will skip the image generation for processed images when the build is running in the Netlify build environment.
More info here


Thank you, that will definitely simplify some things :slight_smile: