Repository navigation
Add default social preview (og:image) to the site - #1203
Open
astra-intelligence wants to merge 1 commit into
Open
astra-intelligence wants to merge 1 commit into
astra-intelligence wants to merge 1 commit into
Conversation
The site emitted zero og:image and zero twitter:card tags because the twitter block was gated on site.twitter.username (unset) and the site.og_image fallback lived inside that block. Every share of the training kit rendered a blank link preview. - Emit twitter:card/twitter:image regardless of site.twitter.username (site/creator stay username-gated) - Emit og:image from site.og_image regardless of site.twitter.username - Add default 1200x630 og-image.png and set og_image in _config.yml
This branch has not been deployed
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.
This PR adds a default social preview image (og:image) to the GitHub Training Kit site. Currently the site emits zero
og:imageand zerotwitter:cardtags, so every link share on Twitter/X, LinkedIn, Slack, Discord, etc. renders as a blank card with no image.Root cause: in
_includes/seo.html, the entiretwitter:*block was gated onsite.twitter.username(which is unset in_config.yml), and thesite.og_imagefallback forog:imagelived inside that block — so with notwitter.usernameconfigured, neither the Twitter card nor the Open Graph image was ever emitted.What's included:
_includes/seo.html— emittwitter:card/twitter:imageregardless ofsite.twitter.username(twitter:site/twitter:creatorstay username-gated); emitog:imagefromsite.og_imageregardless ofsite.twitter.usernameimages/og-image.png— a clean 1200×630 default social preview card (GitHub brand colors, "GitHub Training Kit" title, section pills for Git Cheat Sheets / Git Guides / SVN Migration / Submodules vs Subtrees,training.github.comdomain chip)_config.yml— setog_image: og-image.pngso the default card is used site-wideAfter this, sharing any training-kit page shows a proper preview card instead of a blank link.