forked from godotengine/godot-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Appease our great search engine overlords
This hopefully fixes all translated pages showing up in search engine results, and makes the STABLE version of each page canonical. In turn, this allows us to re-enable indexing of the version-specific pages (see robots.txt changes), as search engines should prefer the canonical (stable) version, and only show the other versions if no canonical (stable) version exists (i.e. because that feature is only in latest, or was removed in stable). It adds proper canonical links for all generated pages, and fixes the existing links between the various translations of a page by both ensuring the pages links to itself with the proper language tag, and by properly linking to the full path of other translated versions.
- Loading branch information
1 parent
b4c2083
commit fd5f6f4
Showing
3 changed files
with
24 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,12 @@ | ||
{% extends "!layout.html" %} | ||
{% block linktags %} | ||
<link rel="alternate" hreflang="en" href="https://docs.godotengine.org/en/" /> | ||
<link rel="alternate" hreflang="de" href="https://docs.godotengine.org/de/" /> | ||
<link rel="alternate" hreflang="es" href="https://docs.godotengine.org/es/" /> | ||
<link rel="alternate" hreflang="fr" href="https://docs.godotengine.org/fr/" /> | ||
<link rel="alternate" hreflang="ko" href="https://docs.godotengine.org/ko/" /> | ||
<link rel="alternate" hreflang="pl" href="https://docs.godotengine.org/pl/" /> | ||
<link rel="alternate" hreflang="pt-br" href="https://docs.godotengine.org/pt-br/" /> | ||
<link rel="alternate" hreflang="uk" href="https://docs.godotengine.org/uk/" /> | ||
<link rel="alternate" hreflang="zh-cn" href="https://docs.godotengine.org/zh-cn/" /> | ||
<link rel="alternate" hreflang="x-default" href="https://docs.godotengine.org/" /> | ||
{{ super() }} | ||
{% endblock %} | ||
{% extends "!layout.html" -%} | ||
{% block linktags -%} | ||
{% if godot_inject_language_links -%} | ||
{% for alternate_lang in godot_docs_supported_languages -%} | ||
<link rel="alternate" hreflang="{{ alternate_lang }}" href="{{ godot_docs_basepath }}{{ alternate_lang }}/{{ godot_canonical_version }}/{{ pagename }}{{ godot_docs_suffix }}" /> | ||
{% endfor -%} | ||
<link rel="alternate" hreflang="x-default" href="{{ godot_docs_basepath }}{{ godot_default_lang }}/{{ godot_canonical_version }}/{{ pagename }}{{ godot_docs_suffix }}" /> | ||
|
||
<link rel="canonical" href="{{ godot_docs_basepath }}{{ lang_attr }}/{{ godot_canonical_version }}/{{ pagename }}{{ godot_docs_suffix }}" /> | ||
{% endif -%} | ||
{{ super() }} | ||
{% endblock -%} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,3 @@ | ||
user-agent: * | ||
disallow: /*/3.2 | ||
disallow: /*/3.1 | ||
disallow: /*/3.0 | ||
disallow: /*/2.1 | ||
|
||
sitemap: https://docs.godotengine.org/sitemap.xml |