I suggest two options:

1) Together with the html files, we store the md5 of the markdown that was last used to produce the html. This function then computes the md5 of the current markdown and if it is different from the one stored, then it updates the html and the md5.

2) We have a python script that periodically (say, for instance, every night) generates new html from the md files.

I like more the second idea, I think it is less overhead for the website.