Closed bbor closed 7 years ago
Hey, are there any maintainers around to take a look at this pull request?
Hey @bbor, I'll take a look at it this weekend. Been a bit busy.
So the code looks good, but I'm wondering, were you able to verify that this indeed works as intended (i.e. it's not loading any templates more than once)? Would be good if we could test it.
Since the loading is done inside Consolidate, the only way I had found to test the order of the load operations was to drop console.log statements inside Consolidate each time a template file load started and each time a load finished. Before the change, it would spam "start" events until it hit the too many files error. After the change, it would print "start-finished" pairs for each input template.
Hmm yeah. I'm tempted to merge it since we want to move to a different engine anyway for the next major release.
@doodzik What do you think?
@ismay I'm in favour of this pr 👍
Cool, I'll merge asap
Released as 1.8.1
See issue #119. With this PR, we first compile a list of all the layout templates that our input files need. We then do a first pass of renders that treats one input file for each of these templates, so that consolidate will load all the templates into its cache. Then, once the templates are all cached, we run through the rest of the input files.