How do I serve a folder of static assets like Sphinx documentation at /docs/ with panel.serve

I’m serving a gallery of panel apps with panel.serve.

I also have some documentation generated as static docs via Sphinx.

How do I serve that documentation as a part of my app?

I would like to serve it at /docs/.

I’m currently serving it on a separate server. I could probably also serve it as a storage resource on Azure. Then I would need to set up some kind of reverse proxying. But for various reasons I would like to avoid all of that.

How can I serve a folder of static sphinx documentation as a part of my Panel Application(s) with panel.serve?

I’ll try to tackle serving of static files pretty soon I hope, for now you could technically add your own handler by supplying extra_patterns to pn.serve. There’s a similar example here for bokeh: https://github.com/bokeh/bokeh/blob/master/examples/howto/server_embed/tornado_embed.py#L49

1 Like

Does this work now? I saw in release 0.11.0 support for serving static content, but its unclear to me how to achieve this.

It works.

Check out the section Static File Hosting

https://panel.holoviz.org/user_guide/Deploy_and_Export.html

Ah yes so it does. I missed the “/assets” as part of the route. Thanks!

1 Like