From f44ef9d3ec6b2865ee94cac3f4c4b8fb656c228d Mon Sep 17 00:00:00 2001 From: Elijah Greenstein Date: Fri, 17 Jul 2026 16:40:52 -0700 Subject: [PATCH] doc: prevent indexing of integrated docs - Updates `add_config.py` to add `seo_noindex` context to the LXD, MicroCeph, and MicroOVN docs. - Sets up base.html file to add to the cloned MicroCeph docs - Sets up extrahead block to append to the cloned MicroOVN docs Note that the LXD upstream docs already have a check for `seo_noindex`, so setting `html['seo_noindex'] = True` is sufficient to add the noindex tags. Signed-off-by: Elijah Greenstein --- doc/.sphinx/_integration/add_config.py | 6 ++++++ doc/.sphinx/_integration/microceph-base.html | 9 +++++++++ doc/.sphinx/_integration/microovn-extrahead.html | 7 +++++++ doc/Makefile | 4 ++++ 4 files changed, 26 insertions(+) create mode 100644 doc/.sphinx/_integration/microceph-base.html create mode 100644 doc/.sphinx/_integration/microovn-extrahead.html diff --git a/doc/.sphinx/_integration/add_config.py b/doc/.sphinx/_integration/add_config.py index da39aa2b2..32752d1d8 100644 --- a/doc/.sphinx/_integration/add_config.py +++ b/doc/.sphinx/_integration/add_config.py @@ -14,6 +14,8 @@ html_css_files = globals().get('html_css_files', []) + ['override-header.css'] html_js_files = globals().get('html_js_files', []) + ['js/overwrite_microcloud_links.js'] tags.add('integrated') + # Prevent indexing of integrated docs + html_context['seo_noindex'] = True elif project == "MicroCeph": html_baseurl = "https://documentation.ubuntu.com/microceph/latest/" # Override default header templates @@ -25,9 +27,13 @@ html_js_files = globals().get('html_js_files', []) + ['overwrite_microcloud_links.js'] # Add "integrated" to the list of custom tags tags.add('integrated') + # Prevent indexing of integrated docs + html_context['seo_noindex'] = True elif project == "MicroOVN": html_baseurl = "https://ubuntu.com/docs/microovn/latest/" tags.add('integrated') html_static_path = globals().get('html_static_path', []) + ["_static"] # Add js to overwrite MicroCloud links html_js_files = globals().get('html_js_files', []) + ['overwrite_microcloud_links.js'] + # Prevent indexing of integrated docs + html_context['seo_noindex'] = True diff --git a/doc/.sphinx/_integration/microceph-base.html b/doc/.sphinx/_integration/microceph-base.html new file mode 100644 index 000000000..453098770 --- /dev/null +++ b/doc/.sphinx/_integration/microceph-base.html @@ -0,0 +1,9 @@ +{% extends "!base.html" %} + +{% block extrahead %} + {{ super() }} + {% if seo_noindex %} + {# Prevent indexing of integrated docs. #} + + {% endif %} +{% endblock %} diff --git a/doc/.sphinx/_integration/microovn-extrahead.html b/doc/.sphinx/_integration/microovn-extrahead.html new file mode 100644 index 000000000..840879e7b --- /dev/null +++ b/doc/.sphinx/_integration/microovn-extrahead.html @@ -0,0 +1,7 @@ +{% block extrahead %} + {{ super() }} + {% if seo_noindex %} + {# Prevent indexing of integrated docs. #} + + {% endif %} +{% endblock %} diff --git a/doc/Makefile b/doc/Makefile index 7ec7516c1..35054a807 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -113,6 +113,10 @@ integrate: cp _templates/google-tag.html integration/microovn/docs/.sphinx/_templates/ cp .sphinx/_integration/header.css integration/microovn/docs/.sphinx/_static/ + # Set up `noindex` tags for MicroCeph and MicroOVN pages + cp .sphinx/_integration/microceph-base.html integration/microceph/docs/_templates/base.html + cat .sphinx/_integration/microovn-extrahead.html >> integration/microovn/docs/.sphinx/_templates/base.html + # Add information about where to find the tags/docs to the doc sets cat .sphinx/_integration/add_config.py >> integration/lxd/doc/conf.py cat .sphinx/_integration/add_config.py >> integration/microceph/docs/conf.py