Issue #26355: Specify canonical URLs in docs pages
Add canonical header link on each page to corresponding major version of the documentation.
Patch by Matthias Bussonnier.
diff --git a/Doc/tools/templates/layout.html b/Doc/tools/templates/layout.html
index 78b3b27..c48754f 100644
--- a/Doc/tools/templates/layout.html
+++ b/Doc/tools/templates/layout.html
@@ -16,6 +16,7 @@
{% block relbar2 %} {% if builder != 'qthelp' %} {{ relbar() }} {% endif %} {% endblock %}
{% block extrahead %}
<link rel="shortcut icon" type="image/png" href="{{ pathto('_static/py.png', 1) }}" />
+ <link rel="canonical" href="https://docs.python.org/2/{{pagename}}.html" />
{% if not embedded %}<script type="text/javascript" src="{{ pathto('_static/copybutton.js', 1) }}"></script>{% endif %}
{% if versionswitcher is defined and not embedded %}<script type="text/javascript" src="{{ pathto('_static/version_switch.js', 1) }}"></script>{% endif %}
{{ super() }}