changeset 106476:b07d454e45a2 2.7

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. [#26355]
author Nick Coghlan <ncoghlan@gmail.com>
date Thu, 09 Feb 2017 17:00:31 +0100
parents 3fd198b80f29
children 54c93e0fe79b
files Doc/tools/templates/layout.html Misc/NEWS
diffstat 2 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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() }}
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -85,6 +85,9 @@ C API
 Documentation
 -------------
 
+- Issue #26355: Add canonical header link on each page to corresponding major
+  version of the documentation. Patch by Matthias Bussonnier.
+
 - Issue #12067: Rewrite Comparisons section in the Expressions chapter of the
   language reference. Some of the details of comparing mixed types were
   incorrect or ambiguous. Added default behaviour and consistency suggestions