diff --git a/docs/user/canonical-urls.rst b/docs/user/canonical-urls.rst index eac1a40e8c4..dad10d4bddd 100644 --- a/docs/user/canonical-urls.rst +++ b/docs/user/canonical-urls.rst @@ -17,11 +17,6 @@ and this is one of the suggested ways to solve it from search engines. .. _canonical URL: https://developers.google.com/search/docs/advanced/crawling/consolidate-duplicate-urls -.. tip:: - - In most cases, Read the Docs will automatically generate a canonical URL for Sphinx projects. - Most Sphinx users do not need to take further action. - .. seealso:: :doc:`/guides/canonical-urls` @@ -48,15 +43,14 @@ thus avoiding duplicating the content. .. note:: - 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. - -Implementation --------------- + 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. -A canonical URL is automatically specified in the HTML output with a ```` element. -For instance, regardless of whether you are viewing this page on ``/en/latest`` or ``/en/stable``, -the following HTML header data will be present: -.. code-block:: html +How to specify the canonical URL +-------------------------------- - +A canonical URL is automatically passed to the build process as ``READTHEDOCS_CANONICAL_URL`` :doc:`environment variable `. +You can use this variable to configure your documentation tool to use it +(eg. Sphinx does this via the ``html_baseurl`` config, MkDocs via ``site_url`` and Pelican with ``SITEURL``)