jdillard / sphinx-sitemap

Sphinx extension to generate a multi-lingual, multi-version sitemap for HTML builds
https://sphinx-sitemap.readthedocs.io/en/latest/index.html
MIT License
55 stars 22 forks source link

Support for DirectoryHTMLBuilder #21

Closed ruksi closed 4 years ago

ruksi commented 4 years ago

Let's imagine a project with the following documentation structure:

index.rst
faq.rst
downloads/index.rst
downloads/linux.rst

sphinx-sitemap would generate a sitemap with:

https://example.com/index.html
https://example.com/faq.html
https://example.com/downloads/index.html
https://example.com/downloads/linux.html

But as we are using DirectoryHTMLBuilder, Sphinx will actually build:

https://example.com/index.html
https://example.com/faq/index.html              <- wrong in sitemap
https://example.com/downloads/index.html
https://example.com/downloads/linux/index.html  <- wrong in sitemap

And thus, as we want to use "directory" style URLs:

https://example.com/
https://example.com/faq/
https://example.com/downloads/
https://example.com/downloads/linux/

Which the main beef of this pull request.

Additionally:

Cheers!

jdillard commented 4 years ago

Thank you! Your changes are now in the latest version on PyPI.