Dynamic OpenGraph og:images in Hugo

To be honest, the switch from a classic CMS to Hugo had a steep learning curve at first, but Hugo is incredible. Even though we have static pages, you can do a lot of “dynamic” stuff. The Problem From the start when I began using Hugo, I had an issue with the open graph images, per default you can specify one image as default in hugo and use post header mages as og:image. Well - I try to keep my blog posts free of images which are not beneficiary to the content. Screenshots are fine but general pseudo matching placeholder images just that you have something for the header 🤷‍♂️. So the problem that came up was all posts ended up with the same image when you linked to the article. ...

November 13, 2025 · solariz