Skip to content

Automate social image generation#508

Open
kacperlukawski wants to merge 21 commits intomainfrom
social-image-generation
Open

Automate social image generation#508
kacperlukawski wants to merge 21 commits intomainfrom
social-image-generation

Conversation

@kacperlukawski
Copy link
Copy Markdown
Member

The social preview images are used by LinkedIn and X natively whenever someone shares a link to the website. This PR attempts to automate this process by using templates specific to the content type. It is possible to define how YAML frontmatter attributes are rendered over the image in a configuration file. Currently, the images are generated when the build.sh script is launched, but eventually should be run either as a GH bot or a pre-commit hook.

Requirements:

  • ImageMagick

@kacperlukawski kacperlukawski added the documentation Improvements or additions to documentation label Mar 5, 2026
@vercel
Copy link
Copy Markdown

vercel bot commented Mar 5, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
haystack-home Ready Ready Preview, Comment Mar 16, 2026 2:42pm

Request Review

@kacperlukawski
Copy link
Copy Markdown
Member Author

@bilgeyucel This PR is a draft, as I see it now more like a github action that runs this process and commits automatically. If we decide to add this, here is how the social preview image would look like:

image

@kacperlukawski kacperlukawski marked this pull request as ready for review March 25, 2026 10:57
@kacperlukawski kacperlukawski requested a review from a team as a code owner March 25, 2026 10:57
Copy link
Copy Markdown
Collaborator

@bilgeyucel bilgeyucel left a comment

Choose a reason for hiding this comment

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

Love this, thank you @kacperlukawski!

output_dir: static/images/social/blog
fields:
title:
font: scripts/social-images/fonts/GreycliffCFExtraBold.ttf
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Can you change the font in the example? It should be Haffer or Inter

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We can remove the image for author pages. They can use the default image

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We can remove the images for blog posts; they already have a dedicated thumbnail.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I see that emojis in the content title are not rendered in the thumbnail. I believe this problem causes the space in front of "Cookbook"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I love having them for integrations! Are they rendered once? What happens when we decide to change the description? Also, do we need to make further changes on the haystack-integrations repo, especially in the frontmatter of the pages?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Can you remove Courier and Greycliff fonts? They are old ones

template: scripts/social-images/templates/blog.png
fields:
title:
font: scripts/social-images/fonts/Inter-Bold.ttf
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Can you replace the fonts with Haffer equivalents?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants