Stop adding random string into image url

First, the string isn’t random. It’s a cache key that includes a hash and image parameters.

Second, according to John Mueller of Google, if you already provide an alt attribute the filename makes little to no difference. I’ve written about this before:

https://discourse.gohugo.io/t/resizing-images-and-renaming-them/46552/6

And I’m sure your alt attribute is excellent in order to comply with accessibility guidelines.

Third, if you want to rename the image, use the resources.Copy function.

2 Likes