This plugin is deprecated, as the new pagelet-only structure, will provide the same functionality through the bootstrap Pagelet
Bigpipe plugin that will provide an easy method to add a general layout to
pages. The Bigpipe#Temper instance is used to load your provided layout. The
template engine of the file is automatically detected. The page is supplied to
the layout as partial by default, changable through options#key.
- Provide default layout to each page
- Utilizes Bigpipe#Temper to automatically detect the template engine
- Fully customizable layout page, options provide full control
Example of layout file using the embedded js template egine
<div><%- partial %></div>The layout plugin is released to npm and can be installed using:
npm install bigpipe-layout --saveTo use the plugin from Bigpipe, simply add it after Bigpipe is initialized or
add it to options#plugins. bigpipe.use will execute the plugin logic. Make sure
the plugin name is unique, e.g. layout by default.
// Usage after initialization
var layout = require('bigpipe-layout')
, BigPipe = require('bigpipe');
//
// Add valid path to base layout.
//
layout.options = { base: '/path/to/base/layout.ejs' };
layout.key = 'custom';
var pipe = new BigPipe(http.createServer(), {
pages: __dirname + '/pages',
public: __dirname + '/public'
}).listen(8080).use(layout);// Usage through createServer options
var layout = require('bigpipe-layout')
, BigPipe = require('bigpipe');
//
// Add valid path to base layout.
//
layout.options = { base: '/path/to/base/layout.ejs' };
var pipe = BigPipe.createServer(8080, {
pages: __dirname + '/pages',
public: __dirname + '/public',
plugins: [ layout ]
});MIT


