title: Include HTML blocks Using node.js
body: <p>This is what I want but probably can't have:</p>
  
  <p>Using node.js and express and maybe ejs, I would like to, while writing a regular HTML file in my client dir, server-side-include a template block of HTML. It would be cool also if I could pass variables into the include from the HTML document.</p>
  
  <p>Sooo something like:</p>
  
  <pre><code> &lt;!doctype html&gt;
   &lt;html&gt;
     &lt;head&gt;
      &lt;%include head, ({title: "Main Page"}) %&gt;   
     &lt;/head&gt;
     &lt;body&gt;
        &lt;% include header, ({pageName: "Home", color: "red"}) %&gt;
      ...
        &lt;&lt;% include footer%&gt;&gt;
     &lt;/body&gt;
   &lt;/html&gt;
  </code></pre>
  
  <p>Is there anyhting in node world that works like this? Or any thing that comes close and that could be maybe adapted for this functionality? I would not use it exactly in the way indicated here, but this is the functionality that I am looking for.  </p>
  
  <p>I have looked into jade, handlebars, ember and ejs, and ejs seems to come the closest. Maybe one of these does this already, but I am just confused about the implementation.</p>
  
  <p>Any suggestions would be great!</p>