-
Notifications
You must be signed in to change notification settings - Fork 27
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
Multiple errors with Nunjucks import #69
Comments
It's difficult for me to say exactly what's happening here without an example repo. If you could create a public repo that recreates the error above I can take a look at it. |
I'm closing this for now by the way, as it doesn't seem to be a bug in in-place. However, feel free to keep the discussion going and point me to a repo if it's up. |
I put it up here: https://github.com/jvolker/Metalsmith-in-place-test Thanks a lot for looking into it! |
No problem. After taking a look this looks like it's related to jstransformers/jstransformer-nunjucks#10. So this seems to be an issue with the particular jstransformer you're using. If not, let me know. |
I'm not sure. The symptoms of the third error described above seem to be very similar.
And in my test repo the template files are on the same level already. So I'm not sure if it actually is related. And in any case I also had |
Not really. The file from which you're calling macros isn't in the same folder as the macros. Try moving everything into src, see if that makes a difference. But regardless, I don't see how this is an error with metalsmith-in-place. You're experiencing problems with a specific templating engine. If there is a bug in in-place let me know, but that does not seem to be the case. |
Yes, you're right. This made a difference and seems to be a bug in the transformer. Thanks again! I again tried to figure out, where those other errors were coming from. Fixed it now! |
👍 You're welcome, glad that solved it. So yeah, that's the bug I ran into as well, weird. Good that it's all working well now. Hopefully the bug in the jstransformer will be solved soon, would be nice. |
Using the Metalsmith
static-site-example
I ran into two issues with Nunjucksimport
.I added
static-site/layouts/macros.html
and try to import it for further usage from withinindex.md
{% import "macros.html" as macros %}
throws:{% import "../layouts/macros.html" as macros %}
throws:I could get around this by adding a variable to the YAML front matter like this:
pathToMacros : ../layouts/macros.html
and called it using that variable{% import pathToMacros as macros %}
But then I end up with the following
template not found
error:Not sure where the issue lies:
metalsmith-in-place
,jstransformer-nunjucks
,Nunjucks
or even my own fault?Thanks for help in advance!
The text was updated successfully, but these errors were encountered: