Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

many-pairs rendering #12

Open
crixlet opened this issue Oct 13, 2019 · 0 comments
Open

many-pairs rendering #12

crixlet opened this issue Oct 13, 2019 · 0 comments

Comments

@crixlet
Copy link

crixlet commented Oct 13, 2019

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant