In ejs we can include a partials in a template in this way (suppose that header.hjs is in view/partials path):
<% include ./partials/header %>
How can I do this in hjs?
In ejs we can include a partials in a template in this way (suppose that header.hjs is in view/partials path):
<% include ./partials/header %>
How can I do this in hjs?
Copyright © 2021 Jogjafile Inc.
I got the answer from this link (the sample in this link uses layout and partials and I just used partials for my case to include a navBar):
The solution is:
In app.js (server.js) define the partial:
app.set('partials', { navBarPartial: 'navBarPartial' } );
In the view which you need this partial, include it: