Who has two thumbnail learnings about hugo blog post images? 馃榾馃憤馃憤

Note that I finally learned how to make hugo blog links sent by imessage have thumbnails and I re-learned how to make hugo blog posts thumbnails show up.

So as far as text message thumbnails go, apparently, since my images live on s3, I needed to make sure their content type was image/jpeg because in my case they were binary/octet-stream.

First blog post where I fixed this was here1.

Content-Type update

The way to change that, was to run,

aws s3api copy-object \
  --bucket my-blog-content \
  --copy-source my-blog-content/2025-09-28-fix-chipped-pint-glass/IMG_7717.jpeg \
  --key 2025-09-28-fix-chipped-pint-glass/IMG_7717.jpeg \
  --metadata-directive REPLACE \
  --content-type image/jpeg \
  --cache-control "public, max-age=31536000, immutable" \
  --acl public-read

from the cli, because this capability was not available for update from the console itself.

The yaml front matter matters too

And if you want an image to be that thumbnail , for the purposes of the hugo index and also for the text message, I had to add the message to the front matter in two different ways

---
title: blahblah
images:
  - "https://s3.amazonaws.com/my-blog-content/2025-09-28-fix-chipped-pint-glass/IMG_7717.jpeg"
cover:
  image: "https://s3.amazonaws.com/my-blog-content/2025-09-28-fix-chipped-pint-glass/IMG_7717.jpeg"
---

Scale it though

That seemed to work as a one off but I would like to batch update all previous content too.

For next time

Also updated the upload func I use to also pass the ContentType now because before I was not. And I learned about the built-in python lib, that will guess the content type

In [1]: import mimetypes

In [2]: key = "foo.png"
   ...: ctype, _ = mimetypes.guess_type(key)
   ...: ctype
Out[2]: 'image/png'

In [3]: key = "foo.jpg"
   ...: ctype, _ = mimetypes.guess_type(key)
   ...: ctype
Out[3]: 'image/jpeg'

In [4]: key = "foo.JPG"
   ...: ctype, _ = mimetypes.guess_type(key)
   ...: ctype
Out[4]: 'image/jpeg'

References

  1. https://michal.piekarczyk.xyz/post/2025-09-28-fix-chipped-pint-glass/