Skip to content

Add social card image (Open Graph / Twitter) - #3

Merged
lesnik512 merged 1 commit into
mainfrom
feat/social-card
Jun 16, 2026
Merged

Add social card image (Open Graph / Twitter)#3
lesnik512 merged 1 commit into
mainfrom
feat/social-card

Conversation

@lesnik512

Copy link
Copy Markdown
Member

Summary

Adds a static social-preview image so links to modern-python.org render a branded card on Twitter/X, LinkedIn, Slack, Discord, etc.

  • Image (docs/assets/social-card.png, 1200×630) — layout C: centered "MODERN PYTHON" wordmark (Futura, matching the logo), a thin divider, and modern-python.org, white on the brand green #356852.
  • Generator (scripts/gen_social_card.py) — reproducible via uv run --with pillow python scripts/gen_social_card.py (run locally; needs the Futura font). Not part of the CI build.
  • Wiring (overrides/main.html + theme.custom_dir: overrides) — adds og:image / twitter:image meta with the absolute card URL and twitter:card = summary_large_image. No imaging dependencies added to CI.

Chose a static card over Material's social plugin to avoid adding Cairo/Pango to the CI build for a single-page site.

Test Plan

  • uv run mkdocs build --strict exits 0
  • site/assets/social-card.png present in build
  • site/index.html contains og:image + twitter:image with https://modern-python.org/assets/social-card.png and twitter:card=summary_large_image
  • Homepage content check still green (all 17 project links)
  • After merge + deploy: validate with a card debugger (e.g. opengraph.xyz or the LinkedIn Post Inspector)

🤖 Generated with Claude Code

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>
@lesnik512
lesnik512 merged commit 50abd98 into main Jun 16, 2026
@lesnik512
lesnik512 deleted the feat/social-card branch June 16, 2026 06:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant