Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate canonical_url in favor of html_baseurl #178

Merged
merged 2 commits into from
Jan 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion alabaster/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
{% if theme_touch_icon %}
<link rel="apple-touch-icon" href="{{ pathto('_static/' ~ theme_touch_icon, 1) }}" />
{% endif %}
{% if theme_canonical_url %}

{# Deprecated in favor of html_baseurl (pageurl). This is already set in the basic theme #}
{% if theme_canonical_url and not pageurl %}
<link rel="canonical" href="{{ theme_canonical_url }}{{ pagename }}.html" />
{% endif %}
{% endblock %}
Expand Down
5 changes: 4 additions & 1 deletion docs/customization.rst
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,15 @@ Settings related to text display, logo, etc.

* ``body_text_align``: Which CSS ``text-align`` value to use for body text
(if there is any.)
* ``canonical_url``: If set, is used as the base URL (set before the relative
* ``canonical_url``: **Deprecated**, please use the html_baseurl_ Sphinx option instead.
If set, is used as the base URL (set before the relative
path/pagename) for a ``<link rel="canonical">`` `canonical URL
<https://developers.google.com/search/docs/crawling-indexing/consolidate-duplicate-urls>`_ header tag.

.. note:: This value must end with a trailing slash.

.. _html_baseurl: https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-html_baseurl

* ``description``: Text blurb about your project, to appear under the logo.
* ``description_font_style``: Which CSS ``font-style`` to use for description
text.
Expand Down