I’ve been using a GNU software package called Webpublish. Here’s some info from the Webpublish page.
WebPublish can be used to manage all of the details that are associated with publishing a local copy of a website to one or more remote servers using File Transfer Protocol (FTP). Using WebPublish to manage the transfer of a website to one or more servers allows the website developer to concentrate on a website’s content…..
Finally, a special feature of WebPublish allows you to have a shell program called each time that a file with a specific extension is about to be transferred to a remote server. This makes it easy to write a script or a program that can make alterations to a file just before it is transferred.
Very handy for managing the documentation I’ve written lately.