ejs-layout
v1.0.15
Published
Embedded JavaScript templates
Downloads
63
Readme
EJS
Embedded JavaScript templates
Installation
$ npm install ejs-layout
var engine = require('ejs-layout');
app.set('view engine', 'ejs');
app.engine('ejs', engine.__express);
Features
- Extend from EJS
- Add : Layout for EJS
Layouts
- views/layout.ejs
<body>
<header>
Welcome to EJS-Layout
</header>
<div id="page-main">
<%+ yield('content') %>
</div>
<footer>
<%+ yield('footer') %>
</footer>
</body>
- views/example.ejs
<%+ extend('layout') %>
<%+ section('content') %>
<h3>This is content for example page</h3>
<%+ endSection %>
<%+ section('footer') %>
<h3>This is footer for example page</h3>
<%+ endSection %>
License
Licensed under the Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
EJS Embedded JavaScript templates copyright 2112 [email protected].