diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 97c4f5a3..587b7b97 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -9,7 +9,7 @@ version: 2 build: os: ubuntu-lts-latest tools: - python: "3.11" + python: "3.12" # You can also specify other tool versions: # nodejs: "16" # rust: "1.55" diff --git a/docs/source/conf.py b/docs/source/conf.py index 71157af3..8b497faa 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -63,6 +63,7 @@ "notfound.extension", "sphinx_copybutton", "sphinx_design", + "sphinx_sitemap", "sphinx_togglebutton", ] @@ -134,11 +135,16 @@ "html_admonition", ] +# sitemap extension configuration +site_url = "https://causalpy.readthedocs.io/" +sitemap_url_scheme = f"{{lang}}{version}/{{link}}" + # -- Options for HTML output ------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output html_theme = "labs_sphinx_theme" html_static_path = ["_static"] +html_extra_path = ["robots.txt"] html_favicon = "_static/favicon_logo.png" # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the @@ -156,6 +162,7 @@ "github_version": "main", "doc_path": "docs/source/", "default_mode": "light", + "baseurl": "https://causalpy.readthedocs.io/", } # -- Options for autodoc ---------------------------------------------------- @@ -167,12 +174,3 @@ # Don't show class signature with the class' name. autodoc_class_signature = "separated" - -# Add "Edit on Github" link. Replaces "view page source" ---------------------- -html_context = { - "display_github": True, # Integrate GitHub - "github_user": "pymc-labs", # Username - "github_repo": "CausalPy", # Repo name - "github_version": "master", # Version - "conf_py_path": "/docs/source/", # Path in the checkout to the docs root -} diff --git a/docs/source/robots.txt b/docs/source/robots.txt new file mode 100644 index 00000000..9fe284a5 --- /dev/null +++ b/docs/source/robots.txt @@ -0,0 +1,12 @@ +# Custom robots.txt file +# It controls the crawling and indexing of your documentation by search engines. +# Part of the configuration happens through readthedocs and part through extensions +# +# You can learn more about robots.txt, including how to customize it, in our rtd docs: +# +# * Our documentation on Robots.txt: https://docs.readthedocs.com/platform/stable/reference/robots.html +# * Our guide about SEO techniques: https://docs.readthedocs.com/platform/stable/guides/technical-docs-seo-guide.html + +User-agent: * + +Sitemap: https://causalpy.readthedocs.io/en/stable/sitemap.xml diff --git a/pyproject.toml b/pyproject.toml index 0523c3c1..946508dd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -80,9 +80,10 @@ docs = [ "sphinx", "sphinx-autodoc-typehints", "sphinx_autodoc_defaultargs", - "labs-sphinx-theme", + "labs-sphinx-theme @ git+https://github.com/pymc-labs/labs-sphinx-theme@v016_update", "sphinx-copybutton", "sphinx-rtd-theme", + "sphinx-sitemap", "statsmodels", "sphinxcontrib-bibtex", "sphinx-notfound-page",