Automate social image generation#508
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
ac83321 to
279d351
Compare
|
@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:
|
bilgeyucel
left a comment
There was a problem hiding this comment.
Love this, thank you @kacperlukawski!
There was a problem hiding this comment.
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"
There was a problem hiding this comment.
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?
991c7e1 to
8bc3540
Compare
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
8bc3540 to
aaf4a7f
Compare
aaf4a7f to
111f522
Compare
Summary
Errors per inputErrors in ./public/benchmarks/index.html
Errors in ./public/nlp-resources/index.html
|
…improved layout and fallback handling
…nd new placement test script
… and FieldConfig for improved structure and maintainability
This reverts commit 79b675f.
…lt path in FileProcessor
- Remove blog template (images not needed; posts have their own thumbnails) - Add exclude list (blog, authors) so generation skips those content types - Switch all title fields from Inter-Bold to HafferBold per reviewer request - Fix Integration.png template path case (was integration.png — broke on Linux CI) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add _strip_emoji() helper that removes emoji, ZWJ, variation selectors, skin-tone modifiers, and regional indicators, then collapses whitespace - Apply stripping to title and description in ContentFile.load() — fixes the leading space before "Cookbook" caused by ImageMagick not rendering the 🧑🍳 emoji - Load exclude list from config.yaml (top-level `exclude:` key) in Config - Add Config.is_excluded() method - Skip excluded content types early in FileProcessor.process() Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Drop Courier Prime, all Greycliff CF variants, and Inter-Bold. Remaining fonts: HafferBold (titles), HafferMedium, HafferRegular, Inter-Regular (body text). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Blog posts have dedicated thumbnails in their frontmatter; author pages will fall back to the site-wide default OG image. Neither needs generated social images, and the generator is now configured to skip both types. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Update YAML example: GreycliffCFExtraBold → HafferBold, drop stale output_dir key - Update fonts list: remove Courier + Greycliff, list only Haffer + Inter - Fix templates table: Integration.png (correct case), cookbook.png, remove stale overview row - Document the new top-level exclude: config key Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Replace `convert` with `magick` to match generate.py and ImageMagick 7+ - Replace nonexistent template_cfg.output_dir with the standard path static/images/social/<type>/ used by FileProcessor Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds .github/workflows/social-images.yml, triggered on pull_request for any content/**/*.md change. The job installs ImageMagick 6 (with a `magick` alias for IM7 compatibility) and the Python deps, diffs the PR head against base to find added/modified/deleted files, runs generate.py --file --force for each changed file, git-rms orphaned PNGs for deleted markdown, then commits and pushes via GITHUB_TOKEN. Fork PRs emit a ::notice:: instead of pushing. build.sh is left untouched — it remains idempotent (skips existing images) and still generates images for external content types (tutorials, cookbook, integrations, advent-of-haystack) whose .md files are pulled at deploy time and are not present in this repo. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Images are now committed to the repo via the GitHub Action on each PR that changes content/*.md files. Regenerating at deploy time requires ImageMagick which isn't available in the build environment and adds unnecessary overhead. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
bf6bb8c to
3ae8d52
Compare
|
@bilgeyucel I would appreciate if you could have another look. I implemented the requested changes + created a github action that triggers the generation once there are any changes in the .md files and commits the images separately. There is a test PR created how that works here: #549 |

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.shscript is launched, but eventually should be run either as a GH bot or a pre-commit hook.Requirements: