Skip to content

feat(social): generate Open Graph / social card images#48

Closed
shenxianpeng wants to merge 1 commit into
mainfrom
claude/cpp-linter-org-gaps-z9fuep
Closed

feat(social): generate Open Graph / social card images#48
shenxianpeng wants to merge 1 commit into
mainfrom
claude/cpp-linter-org-gaps-z9fuep

Conversation

@shenxianpeng

Copy link
Copy Markdown
Member

What

Enables Material's social plugin so every page gets an auto-generated Open Graph / Twitter card image. Sharing a cpp-linter.github.io link to GitHub, Slack, X, etc. will render a rich preview card instead of a bare URL.

Why gated behind an env var

Card generation needs native imaging libs (Cairo & friends), which aren't available in every build environment — notably Netlify PR previews (configured in Netlify's UI, no netlify.toml). To avoid breaking those builds, the plugin is gated:

plugins:
  - social:
      cards: !ENV [CARDS, false]   # off unless explicitly enabled
  • GitHub Pages deploy (deploy.yml) installs the imaging system libs and sets CARDS=true → cards are generated for the published site.
  • Netlify previews / any other env leave CARDS unset → cards are skipped → build still succeeds (previews just won't show the generated cards, which is fine for content review).

Changes

  • mkdocs.yml — add the social plugin with cards: !ENV [CARDS, false].
  • docs/requirements.txtmkdocs-materialmkdocs-material[imaging].
  • .github/workflows/deploy.yml — install libcairo2-dev + friends and set CARDS=true for the build job.

Validation

The Deploy Documentation / build job runs on this PR with CARDS=true and the imaging libs installed, so a green build here means card generation actually works (not just that the config parses).

Note

This branch (claude/cpp-linter-org-gaps-z9fuep) previously carried the squash-merged #47, so the diff may also show docs/index.md — its content is identical to main (no functional change); only the three files above are real changes.

🤖 Generated with Claude Code


Generated by Claude Code

@netlify

netlify Bot commented Jul 25, 2026

Copy link
Copy Markdown

Deploy Preview for cpp-linter-github-io ready!

Name Link
🔨 Latest commit 1fc25a8
🔍 Latest deploy log https://app.netlify.com/projects/cpp-linter-github-io/deploys/6a64dd72e9c5fe00088c00ac
😎 Deploy Preview https://deploy-preview-48--cpp-linter-github-io.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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

Enable Material's social plugin so every page gets an auto-generated
Open Graph / Twitter card image — links shared to GitHub/Slack/X now
render a rich preview instead of a bare URL.

Card generation needs native imaging libs (Cairo etc.), which aren't
available in every build environment (e.g. Netlify PR previews). To keep
those builds working, the plugin is gated behind a CARDS env var that
defaults to false; only the GitHub Pages deploy — where the libs are
installed — sets CARDS=true and actually renders the cards.

- mkdocs.yml: add `social` plugin with `cards: !ENV [CARDS, false]`
- docs/requirements.txt: mkdocs-material -> mkdocs-material[imaging]
- deploy.yml: install imaging system deps and set CARDS=true for the build
@shenxianpeng
shenxianpeng force-pushed the claude/cpp-linter-org-gaps-z9fuep branch from 634e537 to 1fc25a8 Compare July 25, 2026 15:59
@shenxianpeng
shenxianpeng deleted the claude/cpp-linter-org-gaps-z9fuep branch July 25, 2026 19:40
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