moshen / jekyll-asset_bundler

A small plugin for Jekyll to easily bundle and compress site assets
MIT License
101 stars 21 forks source link

YAML bundle is not an Array #14

Closed edwardball closed 11 years ago

edwardball commented 11 years ago

In my footer.html include file, just before the closing </body> tag, I've put the following lines of code:

{% bundle %}
- /js/utils.js
- /js/lunr.js
{% endbundle %}

However, unfortunately, Terminal is giving me the following error and no bundle is being created.

(<unknown>): found character that cannot start any token while scanning for the next token at line 2 column 1
Asset Bundler - Error: YAML bundle is not an Array

- /js/utils.js
- /js/lunr.js

In my _config.yml I have the following:

asset_bundler:
    compress:
        js: yui
        css: yui

Does anyone have any thoughs? I'm on OS10.7, jekyll 1.0.3, liquid 2.5.0, rdiscount 2.1.6, yui-compressor 0.11.0

Thanks

edwardball commented 11 years ago

OK problem solved, it was an issue with white space. If you use the code in this format:

{% bundle %}
- /js/utils.js
- /js/lunr.js
{% endbundle %}

then you need to make sure it is not indented at all (ie each line needs to start at column 1 of your file).

moshen commented 11 years ago

Sorry for the tardy reply, you are correct. The YAML block is whitespace sensitive. I will add a note to the README.

This however, is valid:

    {% bundle %}
- /js/utils.js
- /js/lunr.js
    {% endbundle %}
rocco commented 10 years ago

hey I just experienced the same issue. however I could only make it work when there are no whitespace charactes (tabs in my case) whatsoever before either {% bundle %} or any of the content. no hint in README too :/