]> granicus.if.org Git - python/commitdiff
Issue #26355: Specify canonical URLs in docs pages
authorNick Coghlan <ncoghlan@gmail.com>
Thu, 9 Feb 2017 16:00:31 +0000 (17:00 +0100)
committerNick Coghlan <ncoghlan@gmail.com>
Thu, 9 Feb 2017 16:00:31 +0000 (17:00 +0100)
Add canonical header link on each page to corresponding major version of the documentation.

Patch by Matthias Bussonnier.

Doc/tools/templates/layout.html
Misc/NEWS

index 78b3b27e7c9e63ac9468395af56b8750edfee6c4..c48754f0bcfab356cf9c8fd755d750a62fe5ffb9 100644 (file)
@@ -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() }}
index 69033a3a999a1859bc4ce61c4cd94d9c742cccd9..f0ba8c621345bf440ddf88d6d7973f3588300c5e 100644 (file)
--- 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