# Dynamic OpenGraph Image

**URL:** <https://discourse.gohugo.io/t/dynamic-opengraph-image/52666>\
**Category:** support\
**Created:** [December 6, 2024, 2:47pm UTC](https://discourse.gohugo.io/t/dynamic-opengraph-image/52666 "2024-12-06T14:47:06Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![mansoorbarri](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/mansoorbarri/32/20499_2.png) [@mansoorbarri](https://discourse.gohugo.io/u/mansoorbarri)\
**Post date:** [December 6, 2024, 2:47pm UTC](https://discourse.gohugo.io/t/dynamic-opengraph-image/52666/1 "2024-12-06T14:47:06Z")

</div>

I have developed a theme for my personal use and I want to implement dynamic OG image. Current solutions either don’t work or don’t suit my requirements of being serverless and not resource-heavy.

The theme in question: [GitHub - mansoorbarri/website at dev](https://github.com/mansoorbarri/website/tree/dev)

---

<div class="post-metadata">

**Author:** ![davidsneighbour](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/davidsneighbour/32/24507_2.png) [@davidsneighbour](https://discourse.gohugo.io/u/davidsneighbour)\
**Post date:** [December 7, 2024, 11:45am UTC](https://discourse.gohugo.io/t/dynamic-opengraph-image/52666/2 "2024-12-07T11:45:14Z")

</div>

In [here](https://github.com/mansoorbarri/website/blob/dev/layouts/partials/head.html) add the [internal open graph partial](https://gohugo.io/templates/embedded/#open-graph). From there if you want to change things just do the thing it says in the box 😉

Or use more words to describe what you have done and what failed and why it failed.

---

<div class="post-metadata">

**Author:** ![mansoorbarri](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/mansoorbarri/32/20499_2.png) [@mansoorbarri](https://discourse.gohugo.io/u/mansoorbarri)\
**Post date:** [December 9, 2024, 7:56pm UTC](https://discourse.gohugo.io/t/dynamic-opengraph-image/52666/3 "2024-12-09T19:56:05Z")

</div>

yes but the image is just static, i’m asking about dynamic OG image

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [December 9, 2024, 8:09pm UTC](https://discourse.gohugo.io/t/dynamic-opengraph-image/52666/4 "2024-12-09T20:09:22Z")

</div>

> [@mansoorbarri](#):
>
> dynamic OG image

What does that mean?

1. Do you want to use a page’s “featured” image?
2. Do you want to overlay the page title on a base image?
3. Or perhaps #1 falling back to #2?

---

<div class="post-metadata">

**Author:** ![mansoorbarri](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/mansoorbarri/32/20499_2.png) [@mansoorbarri](https://discourse.gohugo.io/u/mansoorbarri)\
**Post date:** [December 9, 2024, 8:39pm UTC](https://discourse.gohugo.io/t/dynamic-opengraph-image/52666/5 "2024-12-09T20:39:11Z")

</div>

by “dynamic” I meant that I just write some code which is used to generate OG images automatically, rather than me creating them for each blog page. I tinkered with the `partial/opengraph.html` file and got it how I wanted it. Thanks.

file: [website/layouts/partials/opengraph.html at dev · mansoorbarri/website · GitHub](https://github.com/mansoorbarri/website/blob/dev/layouts/partials/opengraph.html)

---

<div class="post-metadata">

**Author:** ![system](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/system/32/1_2.png) [@system](https://discourse.gohugo.io/u/system)\
**Post date:** [December 11, 2024, 8:39pm UTC](https://discourse.gohugo.io/t/dynamic-opengraph-image/52666/6 "2024-12-11T20:39:15Z")

</div>

Closed on December 11, 2024, 8:39pm UTC

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