Skip to content

2.0.0

Compare
Choose a tag to compare
@curbengh curbengh released this 16 Aug 01:36
· 64 commits to master since this release
223c0fd

Breaking change

Feature

  • feat: execute hexo filter with stylus context [#45]
    hexo.extend.filter.register('stylus:renderer', function(style) {
      style
        // we may define a global variable by passing a `Node`
        .define('has-canvas', require('stylus').nodes.false);
        // stylus also casts JavaScript values to their Stylus equivalents when possible
        .define('families', ['Helvetica Neue', 'Helvetica', 'sans-serif'])
        // also allows you to provide a JavaScript-defined function to Stylus
        .define('get-list', function(){
          return ['foo', 'bar', 'baz'];
        });
    })

Misc

  • docs: setting variables [#41]
    • This feature has been available since 0.3.1 but not documented until now.
    • Refer to our guide.