Closed jitendravyas closed 6 years ago
Try to pass as array.
['src/templates', 'src/pages/**/partials']
I tried it but it's not working
.pipe(nunjucksRender({
path: ['src/templates', 'src/pages/**/**/includes']
}))
error
Error: template not found: component1.nunjucks
I think you meant like this:
.pipe(nunjucksRender({
path: ['src/templates/**/*.nunjucks', 'src/pages/**/*.nunjucks']
}))
Here I am selecting all the files which has extension .nunjucks
. If you are storing those nunjucks templates as html files, replace .nunjucks
with .html
.
Array not working is a different problem but even after replacing this path: ['src/templates']
with this path: ['src/templates/*/.nunjucks'] has started giving error
This is also not working
path: ['src/templates', 'src/partials']
I have added more details in my question here http://stackoverflow.com/questions/39766802/array-of-multiple-path-is-not-working-in-nunjucks-for-templates-and-partials
@jitendravyas ['src/templates'] with this path: ['src/templates/*/.nunjucks']
means you're looking for ONE file named .nunjucks
. I believe you meant what @kamlekar mentioned. You might want to read up on globbing / put up a github repo so we can know what you're after. It's hard to debug without a seeing the file structure
@zellwk I think @jitendravyas already got the answer on SO. @jitendravyas please close this issue, if you already got the solution.
I want to keep page specific partial in page directory
Instead
path: 'src/templates'
thispath: 'src/templates', 'src/pages/**/partials'
is it possible? I tried that way but it's not working.