fixing bugs and making templates work correctly

* reorganize templates
* follow the html skeleton from gh-pages