Added functionality for regenerating posts, to be used when templates are changed.