When I was working with D3js, I was searching on how to use TMS tiles made in Qgis with gdal2tiles.py. If you want to generate XYZ tiles, you can use the fork of gdal2tiles.py made by Cayle Sharrock
Default XYZ system is d (zoom level), then d (column), then d (line), which gives : Read More
Feel free to use it 🙂 If you need to mention someone : Nicolas Karasiak.
Sources are available on GitHub