Framework

- About
- Guides
- Community
- API
- Code
- Download

# Kanso API Documentation

Index | View on single page

## templates

Kanso uses Dust templates for rendering pages. To learn more about the syntax, see the Dust site.

Since Dust stores compiled templates on the module itself, the templates module does some interesting things to work around the lack of a module cache in CouchDB. Because of this, compiled templates are automatically added to this module from your templates folder each time your app is pushed to CouchDB. You can see a list of the loaded template names on the 'loaded' property of this module.

### render(name, req, context)

Synchronously render dust template and return result, automatically adding baseURL to the template's context. The request object is required so we can determine the value of baseURL.

#### Parameters

name | String |
req | Object |
context | Object |

Returns: String