Give the Finnish pages their own URLs, linked with hreflang #26

Open
opened 2026-10-15 14:56:51 +03:00 by olli-agent · 0 comments
Collaborator

The Finnish text exists only in data-fi attributes, and public/js/site.js swaps it in on the same URL. A crawler starts with no stored language, so every engine indexes the English text only, and a search in Finnish cannot find the site.

Google's guidance for localized versions gives each language its own URL and links the versions with hreflang: each version lists itself and all the others, and x-default names the fallback. Google does not use hreflang or the lang attribute to detect what language a page is in, so the Finnish text has to be in the HTML of a Finnish URL.

What it takes:

  • Finnish pages at their own URLs (/fi/, /fi/cv/, /fi/glossary/, /fi/quiz/), with the Finnish text in the HTML.
  • <link rel="alternate" hreflang="en">, hreflang="fi" and hreflang="x-default" on every version, or the same alternates in sitemap.xml.
  • A canonical link on each version pointing to itself, not to the English page.
  • The EN/FI toggle becomes a link between the two URLs instead of swapping the text in place.

Open question: the pages are served as written, with no build step. Either the Finnish pages are kept by hand, as a second copy of every page changed together with the first, or both languages are generated from one source in CI, which brings forward the web/ frontend source that ROADMAP plans for a later phase.

The research behind this is in SEO.md.

The Finnish text exists only in `data-fi` attributes, and `public/js/site.js` swaps it in on the same URL. A crawler starts with no stored language, so every engine indexes the English text only, and a search in Finnish cannot find the site. Google's guidance for [localized versions](https://developers.google.com/search/docs/specialty/international/localized-versions) gives each language its own URL and links the versions with `hreflang`: each version lists itself and all the others, and `x-default` names the fallback. Google does not use `hreflang` or the `lang` attribute to detect what language a page is in, so the Finnish text has to be in the HTML of a Finnish URL. What it takes: - Finnish pages at their own URLs (`/fi/`, `/fi/cv/`, `/fi/glossary/`, `/fi/quiz/`), with the Finnish text in the HTML. - `<link rel="alternate" hreflang="en">`, `hreflang="fi"` and `hreflang="x-default"` on every version, or the same alternates in `sitemap.xml`. - A canonical link on each version pointing to itself, not to the English page. - The EN/FI toggle becomes a link between the two URLs instead of swapping the text in place. Open question: the pages are served as written, with no build step. Either the Finnish pages are kept by hand, as a second copy of every page changed together with the first, or both languages are generated from one source in CI, which brings forward the `web/` frontend source that ROADMAP plans for a later phase. The research behind this is in `SEO.md`.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
olli/olli.puhakka.dev#26
No description provided.