From 9b5d0fdee3f99cb7c7df4bd257be501614f01943 Mon Sep 17 00:00:00 2001 From: Ruth Fuchss Date: Tue, 20 Aug 2024 11:44:30 +0200 Subject: [PATCH] doc/integration: add canonical URLs for the other doc sets To let Google know that these are copies of the original doc sets, add a rel="canonical" link element (see https://developers.google.com/search/docs/crawling-indexing/consolidate-duplicate-urls ). This is achieved by setting Sphinx's `html_baseurl` configuration. Signed-off-by: Ruth Fuchss --- doc/.sphinx/_integration/add_config.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/doc/.sphinx/_integration/add_config.py b/doc/.sphinx/_integration/add_config.py index 33d6292bb..7c01db9f5 100644 --- a/doc/.sphinx/_integration/add_config.py +++ b/doc/.sphinx/_integration/add_config.py @@ -11,3 +11,10 @@ # Add the search JavaScript file custom_html_js_files.append('rtd-search.js') + +if project == "LXD": + html_baseurl = "https://documentation.ubuntu.com/lxd/en/latest/" +elif project == "MicroCeph": + html_baseurl = "https://canonical-microceph.readthedocs-hosted.com/en/latest/" +elif project == "MicroOVN": + html_baseurl = "https://canonical-microovn.readthedocs-hosted.com/en/latest/"