Translations of a page are not linked with hreflang, so search engines treat them as unrelated pages
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 4/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 20/100
- issue の種類
- 機能追加
- 明瞭さ
- 明確に書かれている
- 活発さ
- 停滞
- 技術スタック
- html, javascript
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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
- 主要言語
- JavaScript
- スター
- 5
- フォーク
- 9
- 平均マージ
- 19時間 10分
- マージ済み PR(30日)
- 12
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
PlanBCode/hypha のほかの issue
-
Component: User interface Impact: Low Level: Easy Pagetype: Peer reviewed article Type: Bug Value: Visitors
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信
-
Impact: Medium Level: Easy Type: Bug Value: Users
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
Impact: Low Level: Easy Pagetype: Festival Type: Bug Value: Coders
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
Impact: Medium Level: Easy Pagetype: Mailinglist Type: Bug Value: Users
難易度 2/5 1〜3時間 初心者へのやさしさ 79/100
メンテナーはふだん 1 日以内に返信
-
Impact: Low Level: Easy Type: Bug Value: Coders
難易度 1/5 1〜3時間 初心者へのやさしさ 85/100
PlanBCode/hypha#586 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
PlanBCode/hypha の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
mailgun/mailgun.js#544 ·
-
beginner bug frontend
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
BistaDinesh03/critique#266 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
solana-foundation/solana-web3.js#4015 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
area: dependencies auto-generated cwe: 405 dependencies ecosystem: npm help wanted package: minimatch scope: runtime security security-alert severity: medium source: dependabot supply-chain vulnerability
難易度 2/5 半日 初心者へのやさしさ 65/100
tdk-landscape/tdk-cli-core#2811 ·
-
a11y bug confirmed issue
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
open-webui/open-webui#33442 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信