That ended up breaking with PR that changed how Leaflet URLs get generated: https://github.com/simonw/datasette-leaflet/pull/9. I could run the plugin hook inside this plugin to generate the right URLs, but that still feels like the wrong way to do it. I could re-run the logic in datasette-leaflet to build the right URL, but I don't want to.
So client-side is probably the best way to ensure the right CSS and JS files are loaded.
It's also possible I should just load leaflet independently, rather than try to coordinate with a plugin. If I end up with two versions of Leaflet on the page, maybe I can life with that.
This import was probably a bad idea: https://github.com/eyeseast/datasette-geojson-map/blob/main/datasette_geojson_map/__init__.py#L6
That ended up breaking with PR that changed how Leaflet URLs get generated: https://github.com/simonw/datasette-leaflet/pull/9. I could run the plugin hook inside this plugin to generate the right URLs, but that still feels like the wrong way to do it. I could re-run the logic in datasette-leaflet to build the right URL, but I don't want to.
So client-side is probably the best way to ensure the right CSS and JS files are loaded.