fixing bugs and making templates work correctly

* reorganize templates
* follow the html skeleton from gh-pages
* use a global updateable doc from the top Menu