html-include
Process .html files as ejs templates from the document_root
usage
Create a html-include handler for a folder full of .html files:
var htmlinclude = ; var app = ; var includes = // this registers the .html -> ejs template handlerincludes; // we can fill in page specific template variables hereincludes
Inside each .html file we can use the 'include' function for things like headers and footers:
index.html
<% include header.html %> This is the index page <% include footer.html %>
header.html
<%= pagetitle %>
footer.html
page events
each time a template is rendered - the 'page' event is fired with the originating request and a vars object to be populated:
includes
render
you can call the render method from elsewhere in your logic:
app
license
MIT