Monday 12 June 2017

How to include EJS partials using absolute path

I am unable to include EJS partials using absolute path like /partials/footer.ejs When i say this EJS is trying to look this file in my file system root.

So currently i am doing this <% include ../partials/footer.ejs %> But this becomes too hard if i am working on ejs file like /services/webapps/app1.ejs then i have to mention a partial like <% include ../../../partials/footer.ejs %> and if i refactor this file it breaks easily.

So how to include partials with absolute path? so that i can simply say /partials/footer.ejs



via fastfoodcoding

No comments:

Post a Comment