Or use a language that makes it trivial to mix data with logic, so you end up with something like Jade/Haml but with the power of macros.
[:div
(for [p ctrl.pages]
[:a {:href p.url} p.title])
[:button {:onclick ctrl.rotate} "Rotate links"]]