express-ejs-layouts icon indicating copy to clipboard operation
express-ejs-layouts copied to clipboard

Support for recursive layouts

Open hollandjake opened this issue 1 year ago • 0 comments

Say you have a base layout you want to be applied to all pages, but you also have a sub-layout that contains a little extra bloat (such as some extra css files) which is also shared between a few more pages.

Is there any way for this to be achieved?

<!-- base-layout.ejs -->
<html>
<body>
  <nav>Some nav</nav>
  <%- body %>
</body>
</html>
<!-- sub-layout.ejs -->
<div>SOME PAGE BANNER</div> 
<%- body %>
<!-- page.ejs -->
<h1>Page Title</h1>

Expected output

<html>
<body>
  <nav>Some nav</nav>
  <div>SOME PAGE BANNER</div> 
  <h1>Page Title</h1>
</body>
</html>

hollandjake avatar Jul 02 '24 09:07 hollandjake