This is a little script I created to help manage this website. It does 2 things:
1. It does basic macro expansion/replacement on html files. This allows html files to contain non-html tags which can be expanded into html based on the values in a configuration file. For instance, since every html file has the same header, its possible to include an <auto_update_header> tag in every html file and then have 1 definition of <auto_update_header> it in a configuration file. Its then easy to update the entire site’s html by modifying the configuration file and running update_html.py. This makes it easy to make sitewide changes and ensure all pages are up to date.
2. It “intelligently” uploads the website a webserver via FTP. It would be easier to use a standard FTP tool which could perform syncing, but there are many files that I don’t want to be uploaded (eg. .svn directories, non-gif or non-jpg images, etc). The FTP server address, username, and password as well as file and directories to be ignored can be specified in the same configuration file referenced above.
The script is very simple at this point, but should evolve as this webpage does.