Closed kud closed 5 years ago
I put 'em into env.addGlobal instead of data!
Youuhouu
manageEnv: (env) => {
env.addGlobal("componentsDir", PATHS.componentsDir)
env.addGlobal("layoutsDir", PATHS.layoutsDir)
env.addGlobal("pagesDir", PATHS.pagesDir)
env.addGlobal("stylesDir", PATHS.stylesDir)
},
Currently I'm doing this:
It compiles well the files in
pagesGlob
but also excludespartialsGlob
in order to have only pages as final files, not partials, inbuildDir
.In pages, I can do
import
orinclude
of partials in nunjucks, it works well.However, as
partialsGlob
is exclude,data: PATHS,
isn't given to those files, which means I can't use variables likecomponentsDir
.Do you have any idea to make it work?
Thank you.