Skip to content

Commit 9985bfb

Browse files
msbtamotl
authored andcommitted
more canonical changes
1 parent 9afa2df commit 9985bfb

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/crate/theme/rtd/crate/page.html

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,15 @@
44
{# Include main JavaScript/CSS assets #}
55
{% block head_extra %}
66
<script src="{{ pathto('_static/bundle/main.js', 1) }}?ver={{ theme_ver }}"></script>
7+
{%- if custom_baseurl %}
8+
{%- set canonical_page = pagename + ".html" %}
9+
<!--
10+
Always link to the latest version, as canonical.
11+
https://docs.readthedocs.io/en/stable/canonical-urls.html
12+
-->
13+
<link rel="canonical" href="{{ custom_baseurl|e }}{{ canonical_page }}" />
14+
{%- endif %}
15+
716
{% endblock %}
817

918
{# Include Furo icons as first body element #}

0 commit comments

Comments
 (0)