Skip to main content

Simple Sphinx XML Sitemap Extension

CI

This project provides a minimal Sphinx extension that generates an XML sitemap for your documentation. The extension inspects the navigation structure of your project and writes a sitemap.xml file after the HTML build step completes.

The extension does not support internationalisation or multiple languages, but it is suitable for most single language documentation sites.

Installation

Install from PyPI using pip:

pip install simple-sphinx-xml-sitemap

Alternatively add it to your pyproject.toml or requirements.txt file.

Usage

Add the extension to the extensions list in your Sphinx conf.py file and set html_baseurl to the public URL where the documentation will be hosted.

extensions = [
    # other extensions
    'simple_sphinx_xml_sitemap', # note the user of underscores
]

html_baseurl = 'https://example.com/docs/'

Build your documentation as normal. The sphinx-build command becomes available after installing the project's dependencies (for example with uv):

sphinx-build -b html docs docs/_build

After the build completes a sitemap.xml file will be present in the output folder.

Examples

The examples/ directory contains small projects showing different ways to use the extension. The project is configured as a uv workspace so these examples can declare simple-sphinx-xml-sitemap as a dependency in their own pyproject.toml files.

docs

This directory contains only a Sphinx project. To build it run:

cd examples/docs
uv venv
source .venv/bin/activate
uv pip install -e .
sphinx-build -b html . _build

The example conf.py excludes the .venv directory created above so that Sphinx does not try to parse files inside the virtual environment.

hello_world

This example is a tiny Python package with a documentation folder and its own pyproject.toml. Build the docs and install the package in editable mode:

cd examples/hello_world
uv venv
source .venv/bin/activate
uv pip install -e .
sphinx-build -b html docs docs/_build

Both examples will produce a sitemap.xml alongside the HTML output.

Running the tests

Create a virtual environment using uv, install the development dependencies, and run the tests with pytest -q:

uv venv
source .venv/bin/activate
uv pip install -e ".[dev]"
pytest -q

Why

Search engines often crawl every file of a Sphinx build, including sources and module documentation pages that may not be useful. Providing an XML sitemap allows you to indicate which pages are important and helps search engines index your documentation correctly.

Metadata

Release files for simple-sphinx-xml-sitemap 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for simple-sphinx-xml-sitemap 0.1.2
File Size Uploaded Provenance Actions
simple_sphinx_xml_sitemap-0.1.2.tar.gz 5.2 kB With provenance Details for simple_sphinx_xml_sitemap-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for simple-sphinx-xml-sitemap 0.1.2
File Interpreter ABI Platform Actions
simple_sphinx_xml_sitemap-0.1.2-py3-none-any.whl Python 3 none any Details for simple_sphinx_xml_sitemap-0.1.2-py3-none-any.whl

Total release size: 10.9 kB

Release files / simple_sphinx_xml_sitemap-0.1.2.tar.gz

Download URL simple_sphinx_xml_sitemap-0.1.2.tar.gz
Size 5.2 kB
Tags Source
SHA-256 checksum
How to use checksums
2683067e537db0bac942940a6ca6ff30f5b3a813666495c7efe483cf1e59ff81
BLAKE2b-256 checksum
How to use checksums
c98827a72400b9d44989e0e3cc8e1e24a908787fc2c842f2197d57b50f62211f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 21, 2025.

Transparency log

Release files / simple_sphinx_xml_sitemap-0.1.2-py3-none-any.whl

Download URL simple_sphinx_xml_sitemap-0.1.2-py3-none-any.whl
Size 5.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5bec97958981ff4469ef35eaed47e1e43112c366890a3914c1c3f6c7c7b73f51
BLAKE2b-256 checksum
How to use checksums
74460c1e500b07ba96fce2ed1467a2a2008ca0f65033bb69a8ceee8ca002a41d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 21, 2025.

Transparency log

Security for simple-sphinx-xml-sitemap 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for simple_sphinx_xml_sitemap-0.1.2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 21, 2025.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page