Deleting files when updating node.js static htmls

Here is a question for those of you who have been using node.js to export static sites.

I have been using node.js to export all tiddlers and upload to my site. https://giffmex.org/b/Inicio.html

So, adding new htmls is easy.

But when you delete a tiddler on node.js, it doesn’t delete that static from your static folder.

How do you all identify and delete the now defunct static files, either locally or on one’s website via FileZilla? Or do you just leave them there, since they are disconnected dangling orphan thingies?

1 Like

I don’t know, but it occurs to me rather than delete them on the wiki, cause them to generate empty files. The on your site sort by size and delete the empty ones them from the host BEFORE actually deleting them in the wiki.

Delete the output folder for static files before generating new static files. You could have this and the command to generate static files saved together in a script that you run to create static files.

For the server portion, you need an upload tool that not only uploads new files to the server but also deletes files on the server that do not exist locally. I am not familiar with FileZilla and whether it has this ability.

Thanks Tones and Saq, for steering me in the right direction. I will investigate.