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:

  h1 Hello World
    li#one Inside Text
    li#two Inside Text 2
      a(href="") Link

You can insert variable names into your template:

  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'
  templatefile = 'template/result-spanish.jade'
call jadetemplate(templatefile, unitNo, pagevars)

! close .container
write(unitNo,AFORMAT) '</div>'