Is it possible to only include processed page resources in the resulting page bundle?

I have content in the form of a page bundle, and in the page resources I have various large image files in different image formats. When rendering the site, these images get resized to a more Web-sensible size and converted into WebPs, but in my resulting output directory the WebPs are included along with the original files (e.g., there is both a foo.jpg and foo_​huc5b045456b6347704dabc7575f53ffc3_​5828724_​1500x0​_resize_​q75_​h2_​box.webp)

Is it possible to only output the resized files (rather than also including the raw originals) using Hugo itself, or will I need to manually run script over the resulting folder to delete them?

I did try adding 'blog\/posts\/[^/]+\/images\/[^.]+\.(jpe?g|png)' to my config.yml, but it didn’t seem to do anything—I take it is for excluding files from processing rather than the output dir.

See Build Options | Hugo

If you set this to false in a top level cascade section (e.g. on the home page), that should do the trick.

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.