Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot include files from root directory #11

Closed
harshithkashyap opened this issue Jan 10, 2015 · 1 comment
Closed

Cannot include files from root directory #11

harshithkashyap opened this issue Jan 10, 2015 · 1 comment

Comments

@harshithkashyap
Copy link

I have an ejs file that i'm rendering through express say hello.ejs. The views folder structure is views/site/test/hello.ejs

I have the following snippet inside the hello.ejs file

<%- include('/partials/site/templates/navbar.html'); %>

Currently this doesn't work. I can't include files from the views directory.

The current work around i see is going to the parent directory and giving the path

<%- include('../../../partials/course/templates/navbar.html'); %>

It'd be useful to allow include from root dir.

@harshithkashyap harshithkashyap changed the title include files from root directory Cannot include files from root directory Jan 10, 2015
@harshithkashyap
Copy link
Author

Thanks for the quick fix. How do i specify my project location as the root directory? Is there a way to specify the views folder as the root directory as we render the files from express?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant