doc: prevent indexing of integrated docs - #1475
Conversation
- 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 <elijah.greenstein@canonical.com>
2c31f97 to
f44ef9d
Compare
There was a problem hiding this comment.
Pull request overview
Updates the documentation integration workflow to add noindex meta tags to integrated upstream docs (LXD, MicroCeph, MicroOVN) so search engines don’t index the embedded copies within MicroCloud’s documentation site.
Changes:
- Set
html_context['seo_noindex'] = Truefor integrated builds across LXD, MicroCeph, and MicroOVN via the integration config snippet. - Add a MicroCeph
base.htmloverride that injects a<meta name="robots" content="noindex">whenseo_noindexis enabled. - Append an
extraheadblock to MicroOVN’s base template to conditionally inject the samenoindexmeta tag.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| doc/Makefile | Adds integration steps to install template overrides/injections for MicroCeph and MicroOVN noindex behavior. |
| doc/.sphinx/_integration/microovn-extrahead.html | New Jinja snippet to inject noindex in MicroOVN docs via extrahead. |
| doc/.sphinx/_integration/microceph-base.html | New base.html override for MicroCeph that injects noindex in extrahead. |
| doc/.sphinx/_integration/add_config.py | Sets seo_noindex in html_context for integrated builds of LXD/MicroCeph/MicroOVN. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # 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 |
There was a problem hiding this comment.
I don't think this should be an issue for our build workflow, since the integrate target is only run once when building the documentation.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.
Suppressed comments (1)
doc/Makefile:118
cat ... >> integration/microovn/docs/.sphinx/_templates/base.htmlwill silently createbase.htmlif it doesn't exist, which can mask upstream template changes and lead to a broken/partial template without failing the integration step. It’s safer to assert the file exists (and optionally ensure a newline before appending) so the build fails loudly if the expected base template is missing.
# 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
|
With regard to the Copilot comment above about upstream template changes and appending the extrahead block with |
add_config.pyto addseo_noindexcontext to the LXD, MicroCeph, and MicroOVN docs.Note that the LXD upstream docs already have a check for
seo_noindex, so settinghtml['seo_noindex'] = Trueis sufficient to add the noindex tags.Documentation on the
extraheadblock andsuper()is available here: https://www.sphinx-doc.org/en/master/development/html_themes/templating.html.For comparison,
noindextags were added to the older LXD docs versions in canonical/lxd#17984.