Git Product home page Git Product logo

wintersmith-nunjucks's Introduction

wintersmith-nunjucks

nunjucks plugin for wintersmith

How to use

  1. Install globally using npm: npm install -g wintersmith-nunjucks
  2. Add to your wintersmith config.json: "plugins": ["wintersmith-nunjucks"]
  3. Create nunjucks templates ending in .html

How to add custom filters

From the nunjucks documentation at http://jlongster.github.io/nunjucks/templating.html#filters:

Filters are essentially functions that can be applied to variables. They are called with a pipe operator (|) and can take arguments.

For more information on how to write customer Filters, take a look at the API documentation page at: http://jlongster.github.io/nunjucks/api#custom-filters

To use customer filters with wintersmith, put the filter in its own file stored in a filters directory. The filename has to be the name of the filter + '.js'.

so if your filter is in './filters/myfirstfilter.js' add a nunjucks section like this to your config.json:

"nunjucks": {
    "filterdir": "filters",
    "filters": ["myfirstfilter"]
}

It will be available in your templates at 'myfirstfilter'

Filters that are already packaged in modules (like for example nunjucks-date) can be loaded by specifying them like this in your config.json, if they export an install-method:

"nunjucks": {
    "filtermodules": "nunjucks-date"
}

this specific filter would then be available as date in your templates.

Autoescaping

As of nunjucks 2 autoescaping was turned on by default. This plugin reverts that since autoescaping is not usually wanted when used in a static site generator. If you want to change behaviour for some reason you can control it with the autoescape option in your config.json.

"nunjucks": {
    "autoescape": true
}

wintersmith-nunjucks's People

Contributors

earnubs avatar jbuck avatar jnordberg avatar mazdermind avatar travist avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

wintersmith-nunjucks's Issues

Problem with "include" : it is always a keyword, even as a string

Here is my usecase : I just want to test if page.url contains the folder "/features/".
I've seen that in Nunjucks there is no function to achieve that.
So I added underscore.string in my config.json ("require": {..., "_s": "underscore.string"}) and wanted to do that in my template :
<li class="{% if _s.include(page.url, '/features/') %}active{% endif %}"><a href="{{ locals.url }}/fr/features/">Features</a></li>

But then I have "Error: template names must be a string: undefined".

So I tested with _s['include'](page.url, '/features') and I had the same problem...

I think this is a bug... is there a workaround ? Thanks !

locals variables not rendering

If I put a locals variable in my wintersmith config file like this:

"locals": {
  "title": "Some title"
}

and then use the variable in a nunjucks template like this:

{{ locals.title }}

It renders as blank in the generated output.

Variables Not Rendering

Was excited to see nunjucks support for wintersmith! Can't seem to get variables passed through from JSON/Markdown files into Nunjucks templates.

Is this plugin still working?

Versions:

  • node v.4.46
  • wintersmith v2.3.3
  • nunjucks v2.4.2
  • wintersmith-nunjucks v1.1.0

Gives out memory leak warnings.

I get a few hundred of these at the start of running wintersmith preview on a project with around a 100 pages:

(node) warning: possible EventEmitter memory leak detected. 11 listeners added. Use emitter.setMaxListeners() to increase limit.
Trace: 
  at StatWatcher.EventEmitter.addListener (events.js:160:15)
  at Object.fs.watchFile (fs.js:1162:8)
  at EventEmitter.FSWatcher._watch (/Users/kitsunde/Development/navy-career/node_modules/wintersmith-nunjucks-content/node_modules/nunjucks/node_modules/chokidar/index.js:239:8)
  at EventEmitter.FSWatcher._handleFile (/Users/kitsunde/Development/navy-career/node_modules/wintersmith-nunjucks-content/node_modules/nunjucks/node_modules/chokidar/index.js:263:8)
  at /Users/kitsunde/Development/navy-career/node_modules/wintersmith-nunjucks-content/node_modules/nunjucks/node_modules/chokidar/index.js:334:33
  at Object.oncomplete (fs.js:107:15)

(node) warning: possible EventEmitter memory leak detected. 11 listeners added. Use emitter.setMaxListeners() to increase limit.
Trace: 
  at StatWatcher.EventEmitter.addListener (events.js:160:15)
  at Object.fs.watchFile (fs.js:1162:8)
  at EventEmitter.FSWatcher._watch (/Users/kitsunde/Development/navy-career/node_modules/wintersmith-nunjucks-content/node_modules/nunjucks/node_modules/chokidar/index.js:239:8)
  at EventEmitter.FSWatcher._handleFile (/Users/kitsunde/Development/navy-career/node_modules/wintersmith-nunjucks-content/node_modules/nunjucks/node_modules/chokidar/index.js:263:8)
  at /Users/kitsunde/Development/navy-career/node_modules/wintersmith-nunjucks-content/node_modules/nunjucks/node_modules/chokidar/index.js:334:33
  at Object.oncomplete (fs.js:107:15)

(node) warning: possible EventEmitter memory leak detected. 11 listeners added. Use emitter.setMaxListeners() to increase limit.
Trace: 
  at StatWatcher.EventEmitter.addListener (events.js:160:15)
  at Object.fs.watchFile (fs.js:1162:8)
  at EventEmitter.FSWatcher._watch (/Users/kitsunde/Development/navy-career/node_modules/wintersmith-nunjucks-content/node_modules/nunjucks/node_modules/chokidar/index.js:239:8)
  at EventEmitter.FSWatcher._handleFile (/Users/kitsunde/Development/navy-career/node_modules/wintersmith-nunjucks-content/node_modules/nunjucks/node_modules/chokidar/index.js:263:8)
  at /Users/kitsunde/Development/navy-career/node_modules/wintersmith-nunjucks-content/node_modules/nunjucks/node_modules/chokidar/index.js:334:33

npm install error

I get the following error when installing locally on mac osx:

$ npm install wintersmith-nunjucks
\
> [email protected] install /Users/a-user/ws/a-project/node_modules/wintersmith-nunjucks/node_modules/nunjucks/node_modules/chokidar/node_modules/fsevents
> node-gyp rebuild

  CXX(target) Release/obj.target/fse/fsevents.o
In file included from ../fsevents.cc:6:
../node_modules/nan/nan.h:339:13: error: no member named 'New' in 'v8::String'
    return  _NAN_ERROR(v8::Exception::Error, errmsg);
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../node_modules/nan/nan.h:319:50: note: expanded from macro '_NAN_ERROR'
# define _NAN_ERROR(fun, errmsg) fun(v8::String::New(errmsg))
                                     ~~~~~~~~~~~~^
../node_modules/nan/nan.h:343:5: error: no member named 'ThrowException' in namespace 'v8'
    _NAN_THROW_ERROR(v8::Exception::Error, errmsg);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../node_modules/nan/nan.h:324:11: note: expanded from macro '_NAN_THROW_ERROR'
      v8::ThrowException(_NAN_ERROR(fun, errmsg));                             \
      ~~~~^
../node_modules/nan/nan.h:343:5: error: no member named 'New' in 'v8::String'
    _NAN_THROW_ERROR(v8::Exception::Error, errmsg);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../node_modules/nan/nan.h:324:26: note: expanded from macro '_NAN_THROW_ERROR'
      v8::ThrowException(_NAN_ERROR(fun, errmsg));                             \
                         ^~~~~~~~~~~~~~~~~~~~~~~
../node_modules/nan/nan.h:319:50: note: expanded from macro '_NAN_ERROR'
# define _NAN_ERROR(fun, errmsg) fun(v8::String::New(errmsg))
                                     ~~~~~~~~~~~~^
../node_modules/nan/nan.h:348:9: error: no type named 'ThrowException' in namespace 'v8'
    v8::ThrowException(error);
    ~~~~^
../node_modules/nan/nan.h:355:65: error: no member named 'New' in 'v8::String'
    v8::Local<v8::Value> err = v8::Exception::Error(v8::String::New(msg));
                                                    ~~~~~~~~~~~~^
../node_modules/nan/nan.h:356:50: error: expected '(' for function-style cast or type construction
    v8::Local<v8::Object> obj = err.As<v8::Object>();
                                       ~~~~~~~~~~^
../node_modules/nan/nan.h:356:52: error: expected expression
    v8::Local<v8::Object> obj = err.As<v8::Object>();
                                                   ^
../node_modules/nan/nan.h:357:65: error: too few arguments to function call, expected 2, have 1
    obj->Set(v8::String::New("code"), v8::Int32::New(errorNumber));
                                      ~~~~~~~~~~~~~~            ^
/Users/a-user/.node-gyp/0.12.2/deps/v8/include/v8.h:2012:3: note: 'New' declared here
  static Local<Integer> New(Isolate* isolate, int32_t value);
  ^
In file included from ../fsevents.cc:6:
../node_modules/nan/nan.h:357:26: error: no member named 'New' in 'v8::String'
    obj->Set(v8::String::New("code"), v8::Int32::New(errorNumber));
             ~~~~~~~~~~~~^
../node_modules/nan/nan.h:369:12: error: no member named 'New' in 'v8::String'
    return _NAN_ERROR(v8::Exception::TypeError, errmsg);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../node_modules/nan/nan.h:319:50: note: expanded from macro '_NAN_ERROR'
# define _NAN_ERROR(fun, errmsg) fun(v8::String::New(errmsg))
                                     ~~~~~~~~~~~~^
../node_modules/nan/nan.h:373:5: error: no member named 'ThrowException' in namespace 'v8'
    _NAN_THROW_ERROR(v8::Exception::TypeError, errmsg);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../node_modules/nan/nan.h:324:11: note: expanded from macro '_NAN_THROW_ERROR'
      v8::ThrowException(_NAN_ERROR(fun, errmsg));                             \
      ~~~~^
../node_modules/nan/nan.h:373:5: error: no member named 'New' in 'v8::String'
    _NAN_THROW_ERROR(v8::Exception::TypeError, errmsg);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../node_modules/nan/nan.h:324:26: note: expanded from macro '_NAN_THROW_ERROR'
      v8::ThrowException(_NAN_ERROR(fun, errmsg));                             \
                         ^~~~~~~~~~~~~~~~~~~~~~~
../node_modules/nan/nan.h:319:50: note: expanded from macro '_NAN_ERROR'
# define _NAN_ERROR(fun, errmsg) fun(v8::String::New(errmsg))
                                     ~~~~~~~~~~~~^
../node_modules/nan/nan.h:377:12: error: no member named 'New' in 'v8::String'
    return _NAN_ERROR(v8::Exception::RangeError, errmsg);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../node_modules/nan/nan.h:319:50: note: expanded from macro '_NAN_ERROR'
# define _NAN_ERROR(fun, errmsg) fun(v8::String::New(errmsg))
                                     ~~~~~~~~~~~~^
../node_modules/nan/nan.h:381:5: error: no member named 'ThrowException' in namespace 'v8'
    _NAN_THROW_ERROR(v8::Exception::RangeError, errmsg);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../node_modules/nan/nan.h:324:11: note: expanded from macro '_NAN_THROW_ERROR'
      v8::ThrowException(_NAN_ERROR(fun, errmsg));                             \
      ~~~~^
../node_modules/nan/nan.h:381:5: error: no member named 'New' in 'v8::String'
    _NAN_THROW_ERROR(v8::Exception::RangeError, errmsg);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../node_modules/nan/nan.h:324:26: note: expanded from macro '_NAN_THROW_ERROR'
      v8::ThrowException(_NAN_ERROR(fun, errmsg));                             \
                         ^~~~~~~~~~~~~~~~~~~~~~~
../node_modules/nan/nan.h:319:50: note: expanded from macro '_NAN_ERROR'
# define _NAN_ERROR(fun, errmsg) fun(v8::String::New(errmsg))
                                     ~~~~~~~~~~~~^
../node_modules/nan/nan.h:727:49: error: too few arguments to function call, single argument 'isolate' was not specified
    v8::Local<v8::Object> obj = v8::Object::New();
                                ~~~~~~~~~~~~~~~ ^
/Users/a-user/.node-gyp/0.12.2/deps/v8/include/v8.h:2388:3: note: 'New' declared here
  static Local<Object> New(Isolate* isolate);
  ^
In file included from ../fsevents.cc:6:
../node_modules/nan/nan.h:733:49: error: too few arguments to function call, single argument 'isolate' was not specified
    v8::Local<v8::Object> obj = v8::Object::New();
                                ~~~~~~~~~~~~~~~ ^
/Users/a-user/.node-gyp/0.12.2/deps/v8/include/v8.h:2388:3: note: 'New' declared here
  static Local<Object> New(Isolate* isolate);
  ^
In file included from ../fsevents.cc:6:
../node_modules/nan/nan.h:740:12: error: no member named 'Dispose' in 'v8::Persistent<v8::Object, v8::NonCopyablePersistentTraits<v8::Object> >'
    handle.Dispose();
    ~~~~~~ ^
../node_modules/nan/nan.h:741:12: error: no member named 'Clear' in 'v8::Persistent<v8::Object, v8::NonCopyablePersistentTraits<v8::Object> >'
    handle.Clear();
    ~~~~~~ ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make: *** [Release/obj.target/fse/fsevents.o] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:269:23)
gyp ERR! stack     at ChildProcess.emit (events.js:110:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:1074:12)
gyp ERR! System Darwin 14.5.0
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/a-user/ws/a-project/node_modules/wintersmith-nunjucks/node_modules/nunjucks/node_modules/chokidar/node_modules/fsevents
gyp ERR! node -v v0.12.2
gyp ERR! node-gyp -v v1.0.3
gyp ERR! not ok 
npm WARN optional dep failed, continuing [email protected]
[email protected] node_modules/wintersmith-nunjucks
└── [email protected] ([email protected], [email protected])

Customer filter demo?

Hi,

Would you be able to provide an example or boilerplate for a custom filter? For example the 'myfirstfilter'. I'm not sure how to write it?

The Nunjucks docs give this example:

var nunjucks = require('nunjucks');
var env = new nunjucks.Environment();

env.addFilter('shorten', function(str, count) {
    return str.slice(0, count || 5);
});

I adapted that but to no avail. I'm assuming you're doing the addFilter part somewhere? I just need to know how to write the javascript for the filter.

Apologies, I can't imagine the way I'd write it. Still learning how to work with Node/NPM, etc.

index.html

Do you know whether it's possible to use nunjucks for the homepage? Or do I need to create a custom generator plugin?

Unable to find license details

Would like to use your Wintersmith plugin but could not find license details in the readme or a separate license file.

Please see my PR.

I have updated the readme file to mention MIT license( wintersmith is MIT), If it is acceptable to you.

Error Parsing Javascript in Template

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.

Cannot access wintersmiths content tree inside nunjucks template

Hi,

I can't figure out how to access the content tree within an nunjucks template.

Could anyone provide me an example on how to print the list of articles of the blog example from the wintersmith page?

i thought something like this might work:

{% for article in contents.articles %}
        <div class="article-item">
            <h2> An Article </h2>
        </div>
{% endfor %}

but the articles list seems to be empty. Any Idea on this?

Error on installation

Hi,

Hope this is a quick and easy one. I'm on a new machine so it could be something I'm missing that I just can't see but upon running npm install -g wintersmith-nunjucks

I get the following error:

npm install -g wintersmith-nunjucks
\
> [email protected] install /usr/local/lib/node_modules/wintersmith-nunjucks/node_modules/nunjucks/node_modules/chokidar/node_modules/fsevents
> node-gyp rebuild

  CXX(target) Release/obj.target/fse/fsevents.o
In file included from ../fsevents.cc:6:
../node_modules/nan/nan.h:339:13: error: no member named 'New' in 'v8::String'
    return  _NAN_ERROR(v8::Exception::Error, errmsg);
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../node_modules/nan/nan.h:319:50: note: expanded from macro '_NAN_ERROR'
# define _NAN_ERROR(fun, errmsg) fun(v8::String::New(errmsg))
                                     ~~~~~~~~~~~~^
../node_modules/nan/nan.h:343:5: error: no member named 'ThrowException' in namespace 'v8'
    _NAN_THROW_ERROR(v8::Exception::Error, errmsg);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../node_modules/nan/nan.h:324:11: note: expanded from macro '_NAN_THROW_ERROR'
      v8::ThrowException(_NAN_ERROR(fun, errmsg));                             \
      ~~~~^
../node_modules/nan/nan.h:343:5: error: no member named 'New' in 'v8::String'
    _NAN_THROW_ERROR(v8::Exception::Error, errmsg);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../node_modules/nan/nan.h:324:26: note: expanded from macro '_NAN_THROW_ERROR'
      v8::ThrowException(_NAN_ERROR(fun, errmsg));                             \
                         ^~~~~~~~~~~~~~~~~~~~~~~
../node_modules/nan/nan.h:319:50: note: expanded from macro '_NAN_ERROR'
# define _NAN_ERROR(fun, errmsg) fun(v8::String::New(errmsg))
                                     ~~~~~~~~~~~~^
../node_modules/nan/nan.h:348:9: error: no type named 'ThrowException' in namespace 'v8'
    v8::ThrowException(error);
    ~~~~^
../node_modules/nan/nan.h:355:65: error: no member named 'New' in 'v8::String'
    v8::Local<v8::Value> err = v8::Exception::Error(v8::String::New(msg));
                                                    ~~~~~~~~~~~~^
../node_modules/nan/nan.h:357:26: error: no member named 'New' in 'v8::String'
    obj->Set(v8::String::New("code"), v8::Int32::New(errorNumber));
             ~~~~~~~~~~~~^
../node_modules/nan/nan.h:357:65: error: too few arguments to function call, expected 2, have 1
    obj->Set(v8::String::New("code"), v8::Int32::New(errorNumber));
                                      ~~~~~~~~~~~~~~            ^
/Users/paulsmith/.node-gyp/0.12.5/deps/v8/include/v8.h:2012:3: note: 'New' declared here
  static Local<Integer> New(Isolate* isolate, int32_t value);
  ^
In file included from ../fsevents.cc:6:
../node_modules/nan/nan.h:369:12: error: no member named 'New' in 'v8::String'
    return _NAN_ERROR(v8::Exception::TypeError, errmsg);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../node_modules/nan/nan.h:319:50: note: expanded from macro '_NAN_ERROR'
# define _NAN_ERROR(fun, errmsg) fun(v8::String::New(errmsg))
                                     ~~~~~~~~~~~~^
../node_modules/nan/nan.h:373:5: error: no member named 'ThrowException' in namespace 'v8'
    _NAN_THROW_ERROR(v8::Exception::TypeError, errmsg);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../node_modules/nan/nan.h:324:11: note: expanded from macro '_NAN_THROW_ERROR'
      v8::ThrowException(_NAN_ERROR(fun, errmsg));                             \
      ~~~~^
../node_modules/nan/nan.h:373:5: error: no member named 'New' in 'v8::String'
    _NAN_THROW_ERROR(v8::Exception::TypeError, errmsg);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../node_modules/nan/nan.h:324:26: note: expanded from macro '_NAN_THROW_ERROR'
      v8::ThrowException(_NAN_ERROR(fun, errmsg));                             \
                         ^~~~~~~~~~~~~~~~~~~~~~~
../node_modules/nan/nan.h:319:50: note: expanded from macro '_NAN_ERROR'
# define _NAN_ERROR(fun, errmsg) fun(v8::String::New(errmsg))
                                     ~~~~~~~~~~~~^
../node_modules/nan/nan.h:377:12: error: no member named 'New' in 'v8::String'
    return _NAN_ERROR(v8::Exception::RangeError, errmsg);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../node_modules/nan/nan.h:319:50: note: expanded from macro '_NAN_ERROR'
# define _NAN_ERROR(fun, errmsg) fun(v8::String::New(errmsg))
                                     ~~~~~~~~~~~~^
../node_modules/nan/nan.h:381:5: error: no member named 'ThrowException' in namespace 'v8'
    _NAN_THROW_ERROR(v8::Exception::RangeError, errmsg);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../node_modules/nan/nan.h:324:11: note: expanded from macro '_NAN_THROW_ERROR'
      v8::ThrowException(_NAN_ERROR(fun, errmsg));                             \
      ~~~~^
../node_modules/nan/nan.h:381:5: error: no member named 'New' in 'v8::String'
    _NAN_THROW_ERROR(v8::Exception::RangeError, errmsg);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../node_modules/nan/nan.h:324:26: note: expanded from macro '_NAN_THROW_ERROR'
      v8::ThrowException(_NAN_ERROR(fun, errmsg));                             \
                         ^~~~~~~~~~~~~~~~~~~~~~~
../node_modules/nan/nan.h:319:50: note: expanded from macro '_NAN_ERROR'
# define _NAN_ERROR(fun, errmsg) fun(v8::String::New(errmsg))
                                     ~~~~~~~~~~~~^
../node_modules/nan/nan.h:727:49: error: too few arguments to function call, single argument 'isolate' was not specified
    v8::Local<v8::Object> obj = v8::Object::New();
                                ~~~~~~~~~~~~~~~ ^
/Users/paulsmith/.node-gyp/0.12.5/deps/v8/include/v8.h:2388:3: note: 'New' declared here
  static Local<Object> New(Isolate* isolate);
  ^
In file included from ../fsevents.cc:6:
../node_modules/nan/nan.h:733:49: error: too few arguments to function call, single argument 'isolate' was not specified
    v8::Local<v8::Object> obj = v8::Object::New();
                                ~~~~~~~~~~~~~~~ ^
/Users/paulsmith/.node-gyp/0.12.5/deps/v8/include/v8.h:2388:3: note: 'New' declared here
  static Local<Object> New(Isolate* isolate);
  ^
In file included from ../fsevents.cc:6:
../node_modules/nan/nan.h:740:12: error: no member named 'Dispose' in 'v8::Persistent<v8::Object,
      v8::NonCopyablePersistentTraits<v8::Object> >'
    handle.Dispose();
    ~~~~~~ ^
../node_modules/nan/nan.h:741:12: error: no member named 'Clear' in 'v8::Persistent<v8::Object,
      v8::NonCopyablePersistentTraits<v8::Object> >'
    handle.Clear();
    ~~~~~~ ^
../node_modules/nan/nan.h:746:39: error: no member named 'NewSymbol' in 'v8::String'; did you mean 'IsSymbol'?
    NanPersistentToLocal(handle)->Set(NanSymbol("callback"), fn);
                                      ^~~~~~~~~~~~~~~~~~~~~
../node_modules/nan/nan.h:181:38: note: expanded from macro 'NanSymbol'
#define NanSymbol(value) v8::String::NewSymbol(value)
                         ~~~~~~~~~~~~^
/Users/paulsmith/.node-gyp/0.12.5/deps/v8/include/v8.h:1379:8: note: 'IsSymbol' declared here
  bool IsSymbol() const;
       ^
In file included from ../fsevents.cc:6:
../node_modules/nan/nan.h:746:39: error: call to non-static member function without an object argument
    NanPersistentToLocal(handle)->Set(NanSymbol("callback"), fn);
                                      ^~~~~~~~~~~~~~~~~~~~~
../node_modules/nan/nan.h:181:38: note: expanded from macro 'NanSymbol'
#define NanSymbol(value) v8::String::NewSymbol(value)
                         ~~~~~~~~~~~~^~~~~~~~~
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make: *** [Release/obj.target/fse/fsevents.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:269:23)
gyp ERR! stack     at ChildProcess.emit (events.js:110:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:1074:12)
gyp ERR! System Darwin 14.3.0
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/local/lib/node_modules/wintersmith-nunjucks/node_modules/nunjucks/node_modules/chokidar/node_modules/fsevents
gyp ERR! node -v v0.12.5
gyp ERR! node-gyp -v v2.0.1
gyp ERR! not ok
npm WARN optional dep failed, continuing [email protected]
[email protected] /usr/local/lib/node_modules/wintersmith-nunjucks
└── [email protected] ([email protected], [email protected])

Any clues?

I'm on node v0.12.5

Thanks.

Adding custom Tags

Hi there
Can you make some very simple example of how to add custom filters?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.