Skip to content

fix(seo): let the site language decide og:locale and inLanguage - #647

Merged
markdumay merged 1 commit into
mainfrom
fix/og-locale-default
Aug 25, 2026
Merged

fix(seo): let the site language decide og:locale and inLanguage#647
markdumay merged 1 commit into
mainfrom
fix/og-locale-default

Conversation

@markdumay

Copy link
Copy Markdown
Collaborator

Companion to gethinode/hinode#2143, which fixes og:locale and the JSON-LD inLanguage reporting one site-wide value for every language. This is the repo through which that bug reaches real sites.

Why this matters here

config/_default/params.toml ships hardcoded values:

[schema]
    locale = "en-US"
[opengraph]
    locale = "en_US"

Every site scaffolded from this template inherits them. Add a second language and each of its pages reports the locale of the first — a Dutch page serving <html lang="nl"> next to <meta property="og:locale" content="en_US">. The markup is valid and the build is silent; only the two tags disagree, which is why it survives unnoticed. Found on a bilingual production site that had carried en_US on its Dutch tree since launch.

Project configuration wins over the theme by design, so hinode#2143 alone does not reach any site scaffolded from here — these two lines would keep shadowing the derivation. That is what this PR removes.

Change

Both are commented out rather than deleted, so they stay discoverable as the escape hatch when a guess is wrong.

Verification

Built with the currently pinned hinode v3.20.0, i.e. before the fix is released:

before after
og:locale en_US en_US
inLanguage en-US en-US

Unchanged, because the theme's own default supplies the same value today, and once #2143 releases this site is English with languageCode = "en-us", which the new derivation resolves back to en_US. So there is no ordering constraint — this can merge before or after that release, and the scaffold's own output never moves. The change only starts to matter when a user adds a second language, which is precisely the case that used to fail silently.

npm test passes.

🤖 Generated with Claude Code

Sites scaffolded from this template inherit a hardcoded `en_US` / `en-US`, which
Hinode reads as a single site-wide value. Add a second language and every page of
it reports the locale of the first one — valid markup that quietly contradicts the
`lang` attribute beside it, so nothing in the build says anything is wrong. It is
the path by which the bug fixed in gethinode/hinode#2143 reaches real sites.

Comment both out so the theme decides. Output here is unchanged: this site is
English with `languageCode = "en-us"`, which the theme resolves back to `en_US`
either way. It starts to matter the moment a second language is added, which is
exactly when the old default used to fail silently.

Inert until a Hinode release carrying #2143 is picked up; until then the theme's
own default supplies the same value, so this can land in any order.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@netlify

netlify Bot commented Aug 25, 2026

Copy link
Copy Markdown

Deploy Preview for gethinode-template ready!

Name Link
🔨 Latest commit 2c1a88f
🔍 Latest deploy log https://app.netlify.com/projects/gethinode-template/deploys/6a8da06ea9f68200089b52c9
😎 Deploy Preview https://deploy-preview-647--gethinode-template.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.

@markdumay
markdumay merged commit f830708 into main Aug 25, 2026
12 checks passed
@markdumay
markdumay deleted the fix/og-locale-default branch August 25, 2026 14:18
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