Skip to content

many-pairs rendering #12

Description

@crixlet

I realize this may no longer be maintained, but wanted to post in case someone may have run across this.

I'm trying to render to multiple templates based on a json from the example

[{
    "year": 2014, 
    "title": "Mansfield Park", 
    "slug": "mansfield-park"

}, {
    "year": 2012, 
    "title": "Oblomow", 
    "slug": "oblomow"
}, {
    "year": 2012, 
    "title": "Fathers and Sons", 
    "slug": "fathers-and-sons"
}]

and my command render test.handlebars \ --context test1.json --output {value.slug} --many-pairs --verbose

returns the error Rendering a collection requires an output filename template with placeholders, to avoid rendering each context set to the same file.

I've also been unable to get the --many to render from an array, get the following error:

/usr/local/lib/node_modules/render-cli/lib/index.js:74
      contexts.forEach(function(context) {
               ^

TypeError: Cannot read property 'forEach' of undefined

Which may be potentially unrelated?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions