Skip to content

feat: generate ogImage dynamically - #1284

Merged
MoritzWeber0 merged 11 commits into
mainfrom
466-update-preview-image
Nov 21, 2026
Merged

MoritzWeber0 merged 11 commits into
mainfrom
466-update-preview-image

Conversation

@therobrob

@therobrob therobrob commented Oct 25, 2026 •

Copy link
Copy Markdown
Member

The Canvas-API isn’t suitable for og:image, because the needed js isn’t processed within the rendering of the preview image. The targets (whatsapp, facebook, etc.) expect a ready and reachable picture-url.

But there is an other option to add dynamic information to the preview images: the images.Overlay function from HUGO itself (see https://gohugo.io/functions/images/overlay/). So i’ve added the Logo Overlay and the page-title to the content image in this way.

The font is customizable as well, but HUGO needs a ttf-file, not woff2. So i left this one in the standard-font Go Regular (see https://gohugo.io/functions/images/text/).

Because of build problems (however…) I’ve updated the Hugo version.

@therobrob therobrob linked an issue Oct 25, 2026 that may be closed by this pull request
@netlify

netlify Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for fipguide ready!

Name Link
🔨 Latest commit 41828e8
🔍 Latest deploy log https://app.netlify.com/projects/fipguide/deploys/6b01b610d982c62ea8cded40
😎 Deploy Preview https://deploy-preview-1284--fipguide.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions

Copy link
Copy Markdown

Hi there! 👋

Thank you for your contribution to the FIP Guide! 🚀
We appreciate your effort in making rail staff travel information more accessible. 🚄

Checklist before merging:

  • Added a description to the Pull Request
  • Checked the License of new pictures (non-commercial use without attribution)
  • Modified content in English
  • Modified content in German
  • Modified content in French

@therobrob
therobrob marked this pull request as draft October 25, 2026 11:57
@therobrob
therobrob marked this pull request as ready for review October 25, 2026 12:11
@therobrob therobrob added the technical Technical issues, e.g. related to Hugo, HTML, CSS, deployment, etc. label Oct 25, 2026

@MoritzWeber0 MoritzWeber0 left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Robert, that's a great improvement, especially the automatic creation of the images is great ❤️
I just wonder if we need the text in the image, see my two comments.

Comment thread layouts/_partials/helper/ogImage.html Resolved
Comment thread layouts/_partials/helper/ogImage.html Resolved

@MoritzWeber0 MoritzWeber0 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @therobrob, looks good!

@MoritzWeber0
MoritzWeber0 merged commit 2ce916b into main Nov 21, 2026
7 checks passed
@MoritzWeber0
MoritzWeber0 deleted the 466-update-preview-image branch November 21, 2026 15:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

technical Technical issues, e.g. related to Hugo, HTML, CSS, deployment, etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update Preview Image

2 participants