`filename: 'src/src'` works, but `filename: 'src/'` does not?
See original GitHub issueHi folks. Really happy with EJS.
This morning I found some things that seem weird around the <%- include %>
feature.
Here are a couple of questions around the weirdness:
Why do I need filename
on CLI, but not in express?
When I render a template with <%- include('') %>
in an express server, I don’t get an error saying that I must use the filename
option, but when I render the same template on the command line, I do. Does anyone know why that happens?
I think I found a bug – is a string like 'src/'
filtered out anywhere in the code?
When compiling in the command line, if I specify src/
as the filename
, it cannot find the files. If I specify src/src/
as the directory, it finds the files in the appropriate place. I don’t understand, because there’s only a src/
, there is no src/src/
.
I know this seems crazy. If you can’t reproduce or nothing comes to mind, I’ll try harder to reproduce under my conditions. Thanks for your time and effort!
Issue Analytics
- State:
- Created 8 years ago
- Comments:11
Top GitHub Comments
awesome, thanks for the heads up. I created an issue in my repo (nchase/memetica#31) to remind me to fix this.
Well, I did anyhow! 😀
To fix your problem, you should delete Line 25, and edit Lines 53-72 to read:
Note that you’ll need to add error handling.
EJS does have JSDoc annotations. To view the API docs, clone the repo and run:
Open
out/index.html
in your browser, and there you are!If I missed something, you can comment below and I’ll reopen.