Add social card image (Open Graph / Twitter) - #3
Merged
Conversation
Layout C: centered wordmark + divider + domain, white on brand green, 1200x630. Generated by scripts/gen_social_card.py and wired in via an overrides/main.html extrahead block (og:image, twitter:summary_large_image). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a static social-preview image so links to modern-python.org render a branded card on Twitter/X, LinkedIn, Slack, Discord, etc.
docs/assets/social-card.png, 1200×630) — layout C: centered "MODERN PYTHON" wordmark (Futura, matching the logo), a thin divider, andmodern-python.org, white on the brand green#356852.scripts/gen_social_card.py) — reproducible viauv run --with pillow python scripts/gen_social_card.py(run locally; needs the Futura font). Not part of the CI build.overrides/main.html+theme.custom_dir: overrides) — addsog:image/twitter:imagemeta with the absolute card URL andtwitter:card = summary_large_image. No imaging dependencies added to CI.Chose a static card over Material's
socialplugin to avoid adding Cairo/Pango to the CI build for a single-page site.Test Plan
uv run mkdocs build --strictexits 0site/assets/social-card.pngpresent in buildsite/index.htmlcontainsog:image+twitter:imagewithhttps://modern-python.org/assets/social-card.pngandtwitter:card=summary_large_image🤖 Generated with Claude Code