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 21 forks source link

Is it possible to remove the generated language, e.g. "/en/" from the generated sitemap URLs? #71

Closed czue closed 1 year ago

czue commented 1 year ago

Sorry, I couldn't figure this out. My documentation site is only in a single language, english, and I prefer to leave the "/en/" out of all my urls. However, I can't seem to figure out how to tell this library how to remove that path from the URLs. I have tried setting language = None and sitemap_locales = [None] but it still seems to add /en/ to all the paths, which then points to 404 pages.

Is this possible to do with this package?

It seems like no matter what I do these lines:

        if  app.builder.config.language:
            lang = app.builder.config.language + "/"
        else:
            lang = ""

Always cause the language to get set.

czue commented 1 year ago

Oops, ok I figured this out right after I asked. Answer is to add this (removing language):

sitemap_url_scheme = "{version}{link}"

Thanks for being a good rubber duck! :duck: