dadi / web

Web is a drop in front end for websites and web apps. Consumes data from DADI API and others
https://dadi.cloud/en/web/
Other
48 stars 16 forks source link

Pass `page.settings` to the template engine #255

Closed abovedave closed 6 years ago

abovedave commented 7 years ago

This could be useful for engine-makers to allow additional page-level configurations. It will also get rid of this lingering Dust configuration param we have in core:

https://github.com/dadi/web/blob/8815d4a2b47c9087ce62eeceb818cef0bf4a7fe2/dadi/lib/view/index.js#L44

abovedave commented 6 years ago

Existing page.json configs need to change:

From

"settings": {
   "keepWhitespace": true
}

To

"settings": {
    "engine": {
      "keepWhitespace": true
    }
}

Worth updating the dust module too:

https://github.com/dadi/web-dustjs/blob/756f0758e3dbb880534b8c93abc06ebe5a159a8a/index.js#L217-L221

After which it can become the native dust setting of whitespace:

"settings": {
    "engine": {
      "whitespace": true
    }
}