View Engines
The default view engine in Sails is EJS.
Swapping out the view engine
To use a different view engine, you should use npm to install it in your project, then set sails.config.views.engine
(in config/views.js
.)
For example, to switch to jade, run npm install jade --save-dev
, then set engine: 'jade'
in config/views.js
.
Supported view engines
- atpl
- dust (website) (.dust)
- eco
- ect (website)
- ejs (.ejs)
- haml (website)
- haml-coffee (website)
- handlebars (website) (.hbs)
- hogan (website)
- jade (website) (.jade)
- jazz
- jqtpl (website)
- JUST
- liquor
- lodash (website)
- mustache
- QEJS
- ractive
- swig (website)
- templayed
- toffee
- underscore (website)
- walrus (website)
- whiskers
Adding new custom view engines
For instructions on adding support for a view engine not listed above, check out the consolidate project repository.