debrouwere / render

Render text and HTML from Jade, Handlebars, Swig and most other kinds of templates on the command line. Render many files at once and decide where to write to dynamically from the data.
ISC License
17 stars 2 forks source link

Using information from the context #5

Closed codedbypaul closed 9 years ago

codedbypaul commented 9 years ago

I've been struggling to use information from the context option.

render index.jade \ --context page.json --output 'pages/{title}'

Results in:

/Users/paulhilder/.nvm/v0.10.38/lib/node_modules/render-cli/node_modules/simple-path-expressions/lib/compiler.js:142
            throw new exports.InterpolationError("no value provided for `" + p
                  ^
InterpolationError: no value provided for `title`

My json file contains:

{
  "title": "test"
}

Is there anthing really obvious I'm missing?

debrouwere commented 9 years ago

Nope, that should work. I wonder if the code might be namespacing things to page.title. Will investigate, thanks for the report!

debrouwere commented 9 years ago

@codedbypaul before I go on a wild goose chase, any chance you could give the latest version on NPM a try and tell me whether this is still a problem for you? Cheers!

codedbypaul commented 9 years ago

Will give it a go when I get back into the office. :)

On 27 June 2015 at 09:52, Stijn Debrouwere notifications@github.com wrote:

@codedbypaul https://github.com/codedbypaul before I go on a wild goose chase, any chance you could give the latest version on NPM a try and tell me whether this is still a problem for you? Cheers!

— Reply to this email directly or view it on GitHub https://github.com/debrouwere/render/issues/5#issuecomment-115987615.

Paul Hilder.

Portfolio: http:/www.paulhilder.com/ LinkedIn: http://uk.linkedin.com/in/paulhilder Twitter: http://twitter.com/designedbypaul