Install
npm i -S express-posthtml
Usage
Engine
Register PostHTML as Express View Engine
app
Options
Name | Type | Default | Description |
---|---|---|---|
plugins |
{Array} |
[] |
PostHTML Plugins |
options |
{Object} |
{} |
PostHTML Options |
Global
All views will render with this setup, if no local setup provided.
app
res
Local
View specific setup by adding plugins separately to the respective routes. Note that if you have set plugins globally, routes with local setup will not use the global setup by default.
app
res
Extend
If views share common plugins (e.g for BEM Support), but view specific additions are necessary, use the extend option. Now the global setup is used and will be extended with the local plugins of the respective route.
app
res
Example
const app = app const plugins = const options = {} appapp app app
Maintainers
Michael Ciniawsky |