Skip to content

Add Open Graph social preview tags to all pages - #918

Open
astra-intelligence wants to merge 3 commits into
numpy:mainfrom
astra-intelligence:add-og-social-preview
Open

astra-intelligence wants to merge 3 commits into
numpy:mainfrom
astra-intelligence:add-og-social-preview

Conversation

@astra-intelligence

@astra-intelligence astra-intelligence commented Oct 17, 2026 •

Copy link
Copy Markdown

Problem

numpy.org currently emits twitter:* meta tags (from the theme internal template) but zero Open Graph (og:) tags. Every numpy.org URL shared on LinkedIn, Facebook, Slack, WhatsApp, Signal, or any platform that reads og:* renders as a bare text link with no title card, no description, no image — only X/Twitter embeds work today.

Fix

Add the missing Open Graph tags to the site custom head partial (layouts/partials/head.html), which the theme renders on every page:

  • og:site_name / og:type / og:title (per-page via .Title)
  • og:description (same fallback chain as the theme meta.html: page summary → site description)
  • og:image pointing at the existing social asset https://numpy.org/images/numpy-image.jpg (already used as the twitter:image), with explicit width/height and a descriptive alt using the site own tagline.

1 file changed, 8 insertions. No new assets — the existing social card is reused so the Open Graph preview matches the Twitter card exactly. (og:url intentionally omitted: the checklinks deploy plugin follows it to the live site during deploy-preview builds and fails; scrapers fall back to the page URL.)

Verification

Built locally with the exact versions pinned in netlify.toml (Hugo 0.158.0 extended + Dart Sass 1.93.2, make prepare && hugo) and confirmed in the generated HTML:

  • Home page renders all 8 og: tags with https://numpy.org/
  • Subpages get per-page og:title
  • Language variants keep their locale path (e.g. /pt/)
  • Existing twitter:* tags and the jQuery include are unchanged
  • Deploy preview on Netlify: ready (checklinks green)

numpy.org rendered a blank link card on LinkedIn, Facebook, Slack,
WhatsApp, and other platforms that read og:* meta tags. The site only
emitted twitter:* tags (from the theme's internal template), so every
numpy.org URL shared off-X had no title, description, or image.

Add the missing Open Graph tags to the site's custom head partial:
site_name, type, per-page title, description (same fallback chain as the
theme's meta.html), canonical URL, and the existing 1200x-scale social
image (https://numpy.org/images/numpy-image.jpg) with dimensions and alt.

Verified with a local Hugo 0.158.0 + Dart Sass 1.93.2 build (the exact
pins from netlify.toml): all 9 og tags render on the home page, subpages
get per-page og:title/og:url, language variants (e.g. /pt/) keep their
locale path, and the existing twitter:* tags and jQuery include are
unchanged.
@netlify

netlify Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for numpy-org ready!

Name Link
🔨 Latest commit 2f3e378
🔍 Latest deploy log https://app.netlify.com/projects/numpy-org/deploys/6ad365ecfb4d6fa08dd2be14
😎 Deploy Preview https://deploy-preview-918--numpy-org.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.

Admin (Paperclip) and others added 2 commits October 17, 2026 11:49
The checklinks build plugin treats og:url as a canonical relation and
follows it to the live site during deploy-preview builds, adding a
fragment check on https://numpy.org/pt/about/ that fails and breaks the
deploy. Social scrapers fall back to the page URL, so the card still
renders fully via og:title/og:description/og:image/og:site_name.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
@astra-intelligence

Copy link
Copy Markdown
Author

Note on the earlier failed deploy previews: the first two builds of this PR failed in the Netlify checklinks build-plugin stage. Root cause: the og:url meta tag is treated as a canonical relation by the checklinks plugin, which follows it to numpy.org during deploy-preview builds and adds a fragment check that fails, breaking the deploy. Dropped og:url (social scrapers fall back to the page URL, so the card still renders via og:title/og:description/og:image/og:site_name). Deploy preview is now green — please re-check at your convenience.

This branch has not been deployed

No deployments
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