When using Sphinx, there was an option in the make command to clean a directory to remove stale files that are not correctly being served anymore.
There is no readily available option for this in docfx that I have found, but we should be able to create a script that can automatically remove files from the _site directory, remove any existing SVG files that might have an old filename attached to them, and delete the files from the api directory in the case that the submodule has been updated and file names have changed.
There might be other things we can automate with this to help keep the working directory clean, but I think this covers the majority of cases.