-
Notifications
You must be signed in to change notification settings - Fork 49
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
How do you configure templating engines? #6
Comments
I'm using nunjucks, and I'm facing the same issue. I found you can configure nunjucks and add filters globally:
Then you can use the filter normally in your templates:
|
Sorry for the late reply, I've been a little busy. But yeah, as @grancalavera said, you can configure a global instance of the templating engine to solve this. I'm doing something similar here, where I'm instantiating handlebars and passing it some partials, to be used later in metalsmith (or gulpsmith in this case). Let me know if that solves it for you! (I'll also add this to the documentation for posterity btw, it hasn't really been properly documented.) |
Thanks, I ended up using Swig and configuring it globally using |
@Rowno Yeah that could be, I'll check it out. It needs to at least be documented, because I ran into this myself as well. |
So depending on the outcome of this issue: tj/consolidate.js#203, it might indeed be a good idea to expose the Edit: Yeah, |
@ismay your link of https://github.com/superwolff/cape/blob/master/gulp/util/gulpsmith.js 404s now. I'm still struggling with nunjucks and extending directory. Is there a new home for that file? |
Ah! Finally found it. The directory has to be set like this:
|
Nunjucks needs to be able to be configured to disable it's builtin watcher and set the template directory for extending. This could be solved by exposing the consolidate template engines.
See segment-boneyard/metalsmith-templates#55
The text was updated successfully, but these errors were encountered: