We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent df87a40 commit 2f1b2ecCopy full SHA for 2f1b2ec
sphinx_rtd_theme/layout.html
@@ -65,7 +65,10 @@
65
Workaround for: https://github.com/sphinx-doc/sphinx/issues/9730
66
Once a fix is released in Sphinx, put an upper bound on the Sphinx version for the workaround
67
-#}
68
- {%- if builder == 'dirhtml' and pageurl.endswith('.html') %}
+ {%- if builder == 'dirhtml' and pageurl.endswith('index.html') %}
69
+ {#- This expression trims away index.html entirely #}
70
+ <link rel="canonical" href="{{ (pageurl|e)[:-10] }}" />
71
+ {%- elif builder == 'dirhtml' and pageurl.endswith('.html') %}
72
{#- This expression trims away .html and adds a / #}
73
<link rel="canonical" href="{{ (pageurl|e)[:-5] }}/" />
74
{%- else %}
0 commit comments