From 0338e778fc8a2b5b24b4f3b41717c8ebc437bdc6 Mon Sep 17 00:00:00 2001 From: ashishks0522 Date: Fri, 16 Jan 2026 09:24:27 -0500 Subject: [PATCH 1/5] add sitemap --- doc/conf.py | 7 ++++++- doc/requirements.txt | 1 + doc/robots.txt | 4 ++++ 3 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 doc/robots.txt diff --git a/doc/conf.py b/doc/conf.py index 08f7bb8e05..54382ba464 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -132,6 +132,7 @@ def __getattr__(cls, name): "sphinx.ext.viewcode", "sphinx_copybutton", "sphinxext.opengraph", + "sphinx_sitemap", "sphinx_automodapi.automodapi", "sphinx_automodapi.smart_resolver", "sphinx_tabs.tabs", @@ -158,7 +159,7 @@ def __getattr__(cls, name): } # The base URL with a proper language and version. -html_baseurl = os.environ.get("READTHEDOCS_CANONICAL_URL", "/") +html_baseurl = os.environ.get("READTHEDOCS_CANONICAL_URL", "https://docs.pennylane.ai/projects/catalyst/") autosummary_generate = True autosummary_imported_members = False @@ -299,6 +300,10 @@ def __getattr__(cls, name): edit_on_github_project = "PennyLaneAI/catalyst" edit_on_github_branch = "main/doc" +# -- Sitemap settings ----------------------------------------------------- +sitemap_url_scheme = "{link}" +sitemap_excludes = [] # Explicitly set to empty to avoid accidental excludes + # ============================================================ # the order in which autodoc lists the documented members diff --git a/doc/requirements.txt b/doc/requirements.txt index 7f16b8a198..a9804c9cff 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -26,6 +26,7 @@ pybind11 m2r2 mistune==0.8.4 sphinxext-opengraph==0.9.0 +sphinx-sitemap matplotlib==3.10.0 lxml_html_clean diff --git a/doc/robots.txt b/doc/robots.txt new file mode 100644 index 0000000000..19d2813b7e --- /dev/null +++ b/doc/robots.txt @@ -0,0 +1,4 @@ +User-agent: * + +Sitemap: https://docs.pennylane.ai/projects/catalyst/sitemap.xml + From 77b362624e8d6b2ae5619874eef4086f3303a0e7 Mon Sep 17 00:00:00 2001 From: ashishks0522 Date: Fri, 16 Jan 2026 09:48:47 -0500 Subject: [PATCH 2/5] fix line too long --- doc/conf.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/conf.py b/doc/conf.py index 54382ba464..b12c122920 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -159,7 +159,9 @@ def __getattr__(cls, name): } # The base URL with a proper language and version. -html_baseurl = os.environ.get("READTHEDOCS_CANONICAL_URL", "https://docs.pennylane.ai/projects/catalyst/") +html_baseurl = os.environ.get( + "READTHEDOCS_CANONICAL_URL", "https://docs.pennylane.ai/projects/catalyst/" +) autosummary_generate = True autosummary_imported_members = False From 883964230449269d73114320f8718e4f95f87ee8 Mon Sep 17 00:00:00 2001 From: ashishks0522 Date: Fri, 16 Jan 2026 10:11:31 -0500 Subject: [PATCH 3/5] exclude c++ pages --- doc/conf.py | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/doc/conf.py b/doc/conf.py index b12c122920..1802b9605e 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -304,7 +304,8 @@ def __getattr__(cls, name): # -- Sitemap settings ----------------------------------------------------- sitemap_url_scheme = "{link}" -sitemap_excludes = [] # Explicitly set to empty to avoid accidental excludes +# Exclude C++ API pages from sitemap (runtime internals, not for public indexing) +sitemap_excludes = ["api/*"] # ============================================================ @@ -316,3 +317,19 @@ def __getattr__(cls, name): # autodoc_default_flags = ['members'] autosummary_generate = True + + +def add_noindex_to_cpp_pages(app, pagename, templatename, context, doctree): + """ + Add noindex meta tag to C++ API pages generated by Exhale. + + The C++ runtime API is for reference only and should not be indexed by search engines. + """ + if pagename.startswith("api/"): + metatags = context.get("metatags", "") + context["metatags"] = metatags + '\n' + + +def setup(app): + """Sphinx application setup hook.""" + app.connect("html-page-context", add_noindex_to_cpp_pages) From 5fa01282f16bdf324777bcabe705b3c67b3ecd10 Mon Sep 17 00:00:00 2001 From: ashishks0522 Date: Fri, 16 Jan 2026 10:13:48 -0500 Subject: [PATCH 4/5] skip lint as funtion takes 5 arguments --- doc/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/conf.py b/doc/conf.py index 1802b9605e..5e7cacaae2 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -319,7 +319,7 @@ def __getattr__(cls, name): autosummary_generate = True -def add_noindex_to_cpp_pages(app, pagename, templatename, context, doctree): +def add_noindex_to_cpp_pages(app, pagename, templatename, context, doctree): # pylint: disable=unused-argument """ Add noindex meta tag to C++ API pages generated by Exhale. From 59bf9940de90a4d9dc946cfa78b06a91ebec322e Mon Sep 17 00:00:00 2001 From: ashishks0522 Date: Fri, 16 Jan 2026 10:29:44 -0500 Subject: [PATCH 5/5] fmt --- doc/conf.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/doc/conf.py b/doc/conf.py index 5e7cacaae2..eda7ab2d80 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -319,10 +319,12 @@ def __getattr__(cls, name): autosummary_generate = True -def add_noindex_to_cpp_pages(app, pagename, templatename, context, doctree): # pylint: disable=unused-argument +def add_noindex_to_cpp_pages( + app, pagename, templatename, context, doctree +): # pylint: disable=unused-argument """ Add noindex meta tag to C++ API pages generated by Exhale. - + The C++ runtime API is for reference only and should not be indexed by search engines. """ if pagename.startswith("api/"):