mirror of
https://github.com/readthedocs/sphinx_rtd_theme.git
synced 2025-02-25 18:55:21 -06:00
Merge branch 'fix-canonical-in-dirhtml' into fix-canonical-in-dirhtml-with-dirhtml-builder
This commit is contained in:
commit
ae5cd1bbe5
@ -65,10 +65,10 @@
|
||||
Workaround for: https://github.com/sphinx-doc/sphinx/issues/9730
|
||||
Once a fix is released in Sphinx, put an upper bound on the Sphinx version for the workaround
|
||||
-#}
|
||||
{%- if builder == 'dirhtml' and pageurl.endswith('.html') -%}
|
||||
{#- This expression trims away .html and adds a / -#}
|
||||
{%- if builder == 'dirhtml' and pageurl.endswith('.html') %}
|
||||
{#- This expression trims away .html and adds a / #}
|
||||
<link rel="canonical" href="{{ (pageurl|e)[:-5] }}/" />
|
||||
{%- else -%}
|
||||
{%- else %}
|
||||
<link rel="canonical" href="{{ pageurl|e }}" />
|
||||
{%- endif -%}
|
||||
{%- endif -%}
|
||||
|
Loading…
Reference in New Issue
Block a user