You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In most cases, Read the Docs will automatically generate a canonical URL for Sphinx projects.
23
-
Most Sphinx users do not need to take further action.
24
-
25
20
.. seealso::
26
21
27
22
:doc:`/guides/canonical-urls`
@@ -48,15 +43,14 @@ thus avoiding duplicating the content.
48
43
49
44
.. note::
50
45
51
-
If you want your custom domain to be set as the canonical, you need to set ``Canonical: This domain is the primary one where the documentation is served from`` in the :guilabel:`Admin` > :guilabel:`Domains` section of your project settings.
52
-
53
-
Implementation
54
-
--------------
46
+
If you want your custom domain to be set as the canonical,
47
+
you need to set ``Canonical: This domain is the primary one where the documentation is served from``
48
+
in the :guilabel:`Admin` > :guilabel:`Domains` section of your project settings.
55
49
56
-
A canonical URL is automatically specified in the HTML output with a ``<link>`` element.
57
-
For instance, regardless of whether you are viewing this page on ``/en/latest`` or ``/en/stable``,
A canonical URL is automatically passed to the build process as ``READTHEDOCS_CANONICAL_URL`` :doc:`environment variable </reference/environment-variables>`.
55
+
You can use this variable to configure your documentation tool to use it
56
+
(eg. Sphinx does this via the ``html_baseurl`` config, MkDocs via ``site_url`` and Pelican with ``SITEURL``)
0 commit comments