Add og:image dimensions for better social cards (#1955)

Adds og:image:width and og:image:height to the global head so LinkedIn
(and friends) reliably render the large preview card instead of a tiny
thumbnail. The image and the rest of the Open Graph tags were already in
good shape, so this is the missing piece. Also adds a website README
documenting how the cards work and the gotchas.

Co-authored-by: GeekTrainer <GeekTrainer@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
Christopher Harrison
2026-06-09 21:44:42 -07:00
committed by GitHub
parent 50854076f2
commit b3815b0ab3
2 changed files with 65 additions and 0 deletions
+20
View File
@@ -6,7 +6,13 @@ import pagefindResources from "./src/integrations/pagefind-resources";
const site = "https://awesome-copilot.github.com/";
const siteDescription =
"Community-contributed agents, instructions, and skills to enhance your GitHub Copilot experience";
// Social preview image used for all Open Graph / Twitter cards (e.g. LinkedIn, which is
// Open Graph-driven). socialImageWidth/Height MUST match the actual pixels of social-image.png.
// If a page ever overrides og:image, also override og:image:width/height and twitter:image
// (Head.astro derives og:image:secure_url from twitter:image first).
const socialImageUrl = new URL("/images/social-image.png", site).toString();
const socialImageWidth = "2400";
const socialImageHeight = "1260";
// https://astro.build/config
export default defineConfig({
@@ -27,6 +33,20 @@ export default defineConfig({
content: socialImageUrl,
},
},
{
tag: "meta",
attrs: {
property: "og:image:width",
content: socialImageWidth,
},
},
{
tag: "meta",
attrs: {
property: "og:image:height",
content: socialImageHeight,
},
},
{
tag: "meta",
attrs: {