Manton Reece: Referencing photos in Hugo themes, June 26, 2019.

This post provides the code you need to add metadata to the head of a blog post based on the images it contains:

This looks at the photos on a post and takes the first one, adding its URL to a meta tag. If instead of the original photo you want to include a smaller thumbnail, you can use’s special resizing proxy.