rererefactored gh-pages script