Skip to content
This repository has been archived by the owner on Aug 6, 2021. It is now read-only.

Latest commit

 

History

History
22 lines (12 loc) · 1.65 KB

sails.config.views.md

File metadata and controls

22 lines (12 loc) · 1.65 KB

sails.config.views

Configuration for your app's server-side views. The options are conventionally specified in the config/views.js configuration file.

Properties

Property Type Default Details
layout ((string)) -or- ((boolean)) "layout" Set the default layout for your app by specifying the relative path to the desired layout file from your views folder (i.e. views/.) Or disable layout support altogether with false. Built-in support for layouts is only relevant when using ejs (see below)
engine ((string)) "ejs" The view engine your app will use to compile server-side markup into HTML.
extension ((string)) Same as engine The file extension for view files.
locals ((object)) {} Default data to be included as view locals every time a server-side view is compiled anywhere in this app.

Notes

  • If your app is NOT using ejs (the default view engine) Sails will function as if the layout option was set to false. To take advantage of layouts when using a custom view engine like Jade or Handlebars, check out that view engine's documentation to find the appropriate syntax.