Where to put sitemap.xml?

Good day Streamliters,

Does anyone know where to put sitemap.xml so Google can access crawl it?
like this page https://docs.streamlit.io/sitemap-0.xml

What I did:
In the root directory - nope, I cannot access it via domain.com/sitemap.xml.
In the pages directory - also no, cannot be accessed.

Searched the forum too, perhaps I am missing something here?

This is Streamlit deployed to a server with Nginx - and nope I do not think Nginx is limiting sitemap.xml.

Thank you folks :slight_smile:

I

Okay, I finally got Streamlit app to serve sitemap.xml. Solution is to place the following codes in the working directory .streamlit/config.toml file.

[server]
# Enable serving files from a `static` directory in the running app's
# directory.
# Default: false
enableStaticServing = true

Sitemap.xml is also placed in the pages directory but the error message that sitemap.xml is not in pages directory is misleading. I found that it is actually pulling the sitemap from the Streamlit static directory, i.e. ~/.local/share/virtualenvs/xxxxxxxxxx/lib/python3.11/site-packages/streamlit/static/sitemap.xml

If you are on Linux, you can find the right Streamlit static/sitemap.xml easily with this command:-
find / -name sitemap.xml

Hope this helps someone :slight_smile:

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.