Skip to content

Commit

Permalink
Forgot to handle globals
Browse files Browse the repository at this point in the history
  • Loading branch information
nv-amoore committed Oct 19, 2018
1 parent 8297e96 commit c0e4564
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,15 @@ export class NunjucksTemplateEngine implements TemplateEngine {
this._nunjucksEnv.addFilter(filterName, filters[filterName]);
}

if (this.engineOpts.globals) {
for (const globalName in this.engineOpts.globals) {
if (!this.engineOpts.globals.hasOwnProperty(globalName)) {
continue;
}
this._nunjucksEnv.addGlobal(globalName, this.engineOpts.globals[globalName]);
}
}

return this._nunjucksEnv;
}
}

0 comments on commit c0e4564

Please sign in to comment.