diff --git a/docs/user/canonical-urls.rst b/docs/user/canonical-urls.rst index dad10d4bddd..b07d6ca3dbf 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 -.. seealso:: - - :doc:`/guides/canonical-urls` - More information on how to enable canonical URLs in your project. - How Read the Docs generates canonical URLs ------------------------------------------ diff --git a/docs/user/guides/canonical-urls.rst b/docs/user/guides/canonical-urls.rst deleted file mode 100644 index 91e466646ff..00000000000 --- a/docs/user/guides/canonical-urls.rst +++ /dev/null @@ -1,58 +0,0 @@ -How to enable canonical URLs -============================ - -In this guide, we introduce relevant settings for enabling canonical URLs in popular documentation frameworks. - -If you need to customize the domain from which your documentation project is served, -please refer to :doc:`/guides/custom-domains`. - -Sphinx -~~~~~~ - -If you are using :doc:`Sphinx `, -Read the Docs will automatically add a default value of the html_baseurl_ setting matching your canonical domain. - -If you are using a custom ``html_baseurl`` in your ``conf.py``, -you have to ensure that the value is correct. -This can be complex, -supporting pull request builds (which are published on a separate domain), -special branches -or if you are using :term:`subproject` s or :doc:`translations `. -We recommend not including a ``html_baseurl`` in your ``conf.py``, -and letting Read the Docs define it. - -.. _html_baseurl: https://www.sphinx-doc.org/page/usage/configuration.html#confval-html_baseurl - -MkDocs -~~~~~~ - -For :doc:`MkDocs ` we do not define your canonical domain automatically, -but you can use the site_url_ setting to set a similar value. - -In your ``mkdocs.yml``, define the following: - -.. code-block:: yaml - - # Canonical URL, adjust as need with respect to your slug, language, - # default branch and if you use a custom domain. - site_url: https://.readthedocs.io/en/stable/ - -Note that this will define the same canonical URL for all your branches and versions. -According to MkDocs, defining site_url_ will only define the canonical URL of a website and does not affect the base URL of generated links, CSS, or Javascript files. - -.. note:: - - 2 known issues are currently making it impossible to use `environment variables in MkDocs configuration`_. - Once these issues are solved, it will be easier. - - - Support for ``!ENV``: :rtd-issue:`8529` - - Add environment variable for canonical URL: :rtd-issue:`9781` - -.. _site_url: https://www.mkdocs.org/user-guide/configuration/#site_url -.. _environment variables in MkDocs configuration: https://www.mkdocs.org/user-guide/configuration/#environment-variables - -.. warning:: - - If you change your default version or canonical domain, - you'll need to re-build all your versions in order to update their - canonical URL to the new one. diff --git a/docs/user/guides/content/index.rst b/docs/user/guides/content/index.rst index a9da61f0a5f..62f9851c622 100644 --- a/docs/user/guides/content/index.rst +++ b/docs/user/guides/content/index.rst @@ -5,9 +5,6 @@ How-to guides: content, themes and SEO This article explains how documentation can be optimized to appear in search results, ultimately increasing traffic to your docs. -⏩️ :doc:`Enabling canonical URLs ` - In this guide, we introduce relevant settings for enabling canonical URLs in popular documentation frameworks. - ⏩️ :doc:`Using traffic analytics ` In this guide, you can learn to use Read the Docs' built-in traffic analytics for your documentation project. @@ -62,7 +59,6 @@ How-to guides: content, themes and SEO Search engine optimization (SEO) for documentation projects Using traffic analytics Using search analytics - Enabling canonical URLs Enabling offline formats Embedding content from your documentation Managing translations for Sphinx projects diff --git a/docs/user/reference/404-not-found.rst b/docs/user/reference/404-not-found.rst index 85458610f37..f083310f40e 100644 --- a/docs/user/reference/404-not-found.rst +++ b/docs/user/reference/404-not-found.rst @@ -45,7 +45,7 @@ We have examples for some of the most popular tools below. MkDocs automatically generates a ``404.html`` which Read the Docs will use. However, assets will not be loaded correctly unless you define the `site_url`_ configuration value as your site's - :ref:`canonical base URL `. + :doc:`canonical base URL `. .. _sphinx-notfound-page: https://pypi.org/project/sphinx-notfound-page .. _html_extra_path: https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-html_extra_path