ericf/express3-handlebars — pull request #70 by joanniclaborde (2014-08-04 20:41:19+00:00)
Title: Each partials dir can be namespaced (with Promises)

(this is a rewrite of https://github.com/ericf/express3-handlebars/pull/64, based on https://github.com/ericf/express3-handlebars/tree/promises)

As stated in #20, having multiple `partialsDir` can introduce naming collisions. This pull request adds support for partials namespaces. Each `partialsDir` can optionally be specified as an object, with a `dir` and `namespace` properties. Example:

```
var partialsDir = [
'local/views',
{dir: '/otherPackage/shared/views', namespace: 'otherPackage'}
];
...
app.engine('handlebars', exphbs({partialsDir: partialsDir}));
```

If both `local/views` and `/otherPackage/shared/views` contain a template named `status.hbs`, they can be included like this in a view:

```
{{> status}}
{{> otherPackage/status}}
```