The easiest way to serve files is to put them into the static directory.
For more dynamic and readable layouts, you can use an HTML templating system similar to Jade or HAML:
body
h1 Hello World
ul.className
li#one Inside Text
li#two Inside Text 2
li
a(href="http://example.com") Link
You can insert variable names into your template:
h4
span #{name}
small #{occupation}
Control functions (for / if - else - endif) and container divs should be printed directly in the controller.
This is also where you pass info to the template engine:
! open .container write(unitNo,AFORMAT) '<div class="container">' ! use a 2D array for key-value pairs - pagevars(1,1) = 'name' pagevars(1,2) = 'Nick' pagevars(2,1) = 'occupation' pagevars(2,2) = 'mapmaker' ! use URL variable ?lang=__ to fill in this variable call cgi_get(dict, 'lang', language) if (language == 'english') then templatefile = 'template/result-english.jade' else templatefile = 'template/result-spanish.jade' endif call jadetemplate(templatefile, unitNo, pagevars) ! close .container write(unitNo,AFORMAT) '</div>'