Translations of a page are not linked with hreflang, so search engines treat them as unrelated pages
I maintainer di solito rispondono entro 1 giorno
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 20/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Ferma
- Stack tecnologico
- html, javascript
- Ambito
- internationalization, search
Direzione di ricerca
The issue links open pull request #610, which already implements the proposal. Review that pull request and the existing hypha_setBodyClass(), HTMLDocument::linkStyle(), and hypha_indexLanguages() entry points to understand the change. The requested result is reciprocal alternate links for translated pages, an x-default link, and hreflang attributes on language-list links, with no annotations on single-language pages or views.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Hypha stores the translations of a page together (one page in hypha.xml with a language child per translation), and shows them in the language list next to the page name. Search engines are not told: no page has <link rel="alternate" hreflang="...">, and the links of the language list carry no hreflang. Google and Bing therefore treat nl/Over_ons and en/About_us as unrelated pages, may show the Dutch page to an English searcher, and may consider near-identical translations as duplicates.
Evidence (PHP 8.2 container of docs/container, fictional test site, page nl/Over_ons with English translation en/About_us):
$ curl -s http://127.0.0.1:8172/nl/Over_ons | grep -c 'hreflang'
0
$ curl -s http://127.0.0.1:8172/nl/Over_ons | grep -o '<span class="language"><a[^>]*>'
<span class="language"><a href="en/About_us">
Proposal (as described by Google, "Tell Google about localized versions of your page", and RFC 8288 for rel="alternate"):
- Every page that exists in more than one language gets in its head one
<link rel="alternate" hreflang="<code>" href="<absolute url>">per translation, its own language included (the annotations must be reciprocal). - One extra
hreflang="x-default"link points to the version in the site's default language. - Only the page itself, not views such as
editortranslate, and not a page with one language. - The links of the language list (
hypha_indexLanguages()) gethreflangas well.
The linked pull request does that in a new hypha_setAlternateLinks() next to hypha_setBodyClass(), with a small HTMLDocument::linkAlternate() next to linkStyle().
Related, not part of this: <html lang> per content language, canonical URLs, title and description (#521); Vary: Accept-Language (#593); the sitemap could list the alternates too (#375). Page names outside ASCII need #541 for the alternate URLs to resolve.
🤖 Generated with Claude Code
- Lingua principale
- JavaScript
- Stelle
- 5
- Fork
- 9
- Merge medio
- 18h 7m
- PR unite (30g)
- 11
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di PlanBCode/hypha
-
Impact: Medium Level: Easy Type: Bug Value: Users
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
Impact: Low Level: Easy Pagetype: Festival Type: Bug Value: Coders
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
Impact: Medium Level: Easy Pagetype: Mailinglist Type: Bug Value: Users
Difficoltà 2/5 1-3 ore Idoneità per principianti 79/100
I maintainer di solito rispondono entro 1 giorno
-
Impact: Low Level: Easy Type: Bug Value: Coders
Difficoltà 1/5 1-3 ore Idoneità per principianti 85/100
PlanBCode/hypha#586 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Impact: Medium Level: Easy Type: Bug Usecase: De Stadsbron Value: Visitors
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
PlanBCode/hypha#522 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di PlanBCode/hypha
Issue simili
-
bug documentation
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
awslabs/visual-asset-management-system#880 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
I maintainer di solito rispondono entro 1 giorno
-
[BUG]: Workspace settings forms stay at 50% width on narrow screens and wrap text word by wordApertapossible bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
Mintplex-Labs/anything-llm#6889 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
swc-project/swc-next#1165 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
nhsuk/nhsuk-prototype-kit-package#439 ·
I maintainer di solito rispondono entro 1 giorno