moving functions to layout.haml
Merge branch 'single_page'