sphinx-doc / alabaster

Lightweight, configurable Sphinx theme
http://alabaster.readthedocs.io/
Other
738 stars 189 forks source link

support for <link rel="canonical"> not compatible with dirhtml builder #122

Open makhomed opened 7 years ago

makhomed commented 7 years ago

If I turn on canonical_url in config and use dirhtml builder, - Alabaster generates invalid urls.

url should be https://www.example.com/en/latest/tutorial/ but Alabaster generates https://www.example.com/en/latest/tutorial.html and this is lead to 404 errors.

bug probably here: alabaster/layout.html

  {% if theme_canonical_url %}
    <link rel="canonical" href="{{ theme_canonical_url }}{{ pagename }}.html"/>
  {% endif %}