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

Error Parsing Javascript in Template #17

Open
scolby33 opened this issue May 20, 2015 · 0 comments
Open

Error Parsing Javascript in Template #17

scolby33 opened this issue May 20, 2015 · 0 comments

Comments

@scolby33
Copy link

I am trying to adapt wintersmith's default archive.jade template to Nunjucks and am having difficulty with this bit of javascript, which works correctly with the Jade template:

- var archives = _.chain(env.helpers.getArticles(contents)).groupBy(function(item) {
-    return item.date.getFullYear()
- }).value()

My attempt to implement this in Nunjucks looks like this:

{% set archives = _.chain(env.helpers.getArticles(contents)).groupBy(fucntion(item){return item.date.getFullYear()}).value() %}

When building or previewing, this raises a parseSignature error at column 82 of that line (after the 'm' of function(item)):

parseSignature: expected comma after expression

I have searched all over but cannot seem to find any mention of this issue or a solution. I find it hard to believe that this is a bug in either your plugin or in Nunjucks, but I don't know where else this issue could be coming from.

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