Skip to content

Declare alternate languages on translated pages#1151

Open
jneidel wants to merge 1 commit intojpanther:devfrom
jneidel:dev
Open

Declare alternate languages on translated pages#1151
jneidel wants to merge 1 commit intojpanther:devfrom
jneidel:dev

Conversation

@jneidel
Copy link
Contributor

@jneidel jneidel commented Feb 21, 2026

This MR declare alternate languages explicitly, if a page is translated.

Why is this necessary? The sitemap already declares alternates:

            <xhtml:link
              rel="alternate"
              hreflang="{{ .Language.Lang }}"
              href="{{ .Permalink }}"
              />{{ end }}

That does work, but for ahrefs this is not enough:
image
(Feb 15 scan was after I deployed the fix on my site.)

image

After the fix:
image

Fix on npm run example:
image

@netlify
Copy link

netlify bot commented Feb 21, 2026

Deploy Preview for hugo-congo ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit c014995
🔍 Latest deploy log https://app.netlify.com/projects/hugo-congo/deploys/69999e1e2e595e00081c8734
😎 Deploy Preview https://deploy-preview-1151--hugo-congo.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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant