How to create sitemap.xml file with sphinx?

Here it says, "The custom entry name itself is the document containing the toctree directive. This is useful if you want to generate a sitemap from toctree." And I was looking at this thred - Using self to generate a sitemap with toctree in the sphinx seems broken? ... I can't seem to get this to work.

Is there somewhere that has a detailed example of a Sphinx sitemap that I can look at?

+3


source to share


1 answer


I ended up using a sitemap generator in this theme with my own. https://github.com/guzzle/guzzle_sphinx_theme

# Import guzzle theme https://github.com/guzzle/guzzle_sphinx_theme
# Not actually using the theme but intead using the
# sitemap functionality and overriding the theme/templates in source/
html_translator_class = 'guzzle_sphinx_theme.HTMLTranslator'
html_theme_path = guzzle_sphinx_theme.html_theme_path()
html_theme = 'guzzle_sphinx_theme'
extensions.append("guzzle_sphinx_theme")
html_theme_options = {
    "base_url": "YOURSITEURL"
}

      



I am overriding everything in my original directory. I am not using other parts of the theme other than the Sitemap generator. Quite a messy solution, but it worked for me.

+1


source







All Articles