rbuchberger / jekyll_picture_tag

Easy responsive images for Jekyll.
https://rbuchberger.github.io/jekyll_picture_tag/
BSD 3-Clause "New" or "Revised" License
622 stars 106 forks source link

Unable to build #33

Closed maziarzamani closed 9 years ago

maziarzamani commented 10 years ago

I attempted to install the plugin but i seem to be getting a Liquid Exception which i cant seem to solve:

jekylltest:/var/www/blog$ jekyll build --trace
Configuration file: /var/www/blog/_config.yml
            Source: /var/www/blog
       Destination: /var/www/blog/_site
      Generating...   Liquid Exception: undefined method `[]' for nil:NilClass in _posts/2014-03-06-first-classd-amp.markdown
/var/www/blog/_plugins/picture_tag.rb:42:in `render': undefined method `[]' for nil:NilClass (NoMethodError)
    from /var/lib/gems/1.9.1/gems/liquid-2.5.5/lib/liquid/block.rb:106:in `block in render_all'
    from /var/lib/gems/1.9.1/gems/liquid-2.5.5/lib/liquid/block.rb:93:in `each'
    from /var/lib/gems/1.9.1/gems/liquid-2.5.5/lib/liquid/block.rb:93:in `render_all'
    from /var/lib/gems/1.9.1/gems/liquid-2.5.5/lib/liquid/block.rb:82:in `render'
    from /var/lib/gems/1.9.1/gems/liquid-2.5.5/lib/liquid/template.rb:124:in `render'
    from /var/lib/gems/1.9.1/gems/liquid-2.5.5/lib/liquid/template.rb:132:in `render!'
    from /var/lib/gems/1.9.1/gems/jekyll-1.4.3/lib/jekyll/convertible.rb:88:in `render_liquid'
    from /var/lib/gems/1.9.1/gems/jekyll-1.4.3/lib/jekyll/convertible.rb:150:in `do_layout'
    from /var/lib/gems/1.9.1/gems/jekyll-1.4.3/lib/jekyll/post.rb:259:in `render'
    from /var/lib/gems/1.9.1/gems/jekyll-1.4.3/lib/jekyll/site.rb:239:in `block in render'
    from /var/lib/gems/1.9.1/gems/jekyll-1.4.3/lib/jekyll/site.rb:238:in `each'
    from /var/lib/gems/1.9.1/gems/jekyll-1.4.3/lib/jekyll/site.rb:238:in `render'
    from /var/lib/gems/1.9.1/gems/jekyll-1.4.3/lib/jekyll/site.rb:39:in `process'
    from /var/lib/gems/1.9.1/gems/jekyll-1.4.3/lib/jekyll/command.rb:18:in `process_site'
    from /var/lib/gems/1.9.1/gems/jekyll-1.4.3/lib/jekyll/commands/build.rb:23:in `build'
    from /var/lib/gems/1.9.1/gems/jekyll-1.4.3/lib/jekyll/commands/build.rb:7:in `process'
    from /var/lib/gems/1.9.1/gems/jekyll-1.4.3/bin/jekyll:77:in `block (2 levels) in <top (required)>'
    from /var/lib/gems/1.9.1/gems/commander-4.1.6/lib/commander/command.rb:180:in `call'
    from /var/lib/gems/1.9.1/gems/commander-4.1.6/lib/commander/command.rb:180:in `call'
    from /var/lib/gems/1.9.1/gems/commander-4.1.6/lib/commander/command.rb:155:in `run'
    from /var/lib/gems/1.9.1/gems/commander-4.1.6/lib/commander/runner.rb:422:in `run_active_command'
    from /var/lib/gems/1.9.1/gems/commander-4.1.6/lib/commander/runner.rb:82:in `run!'
    from /var/lib/gems/1.9.1/gems/commander-4.1.6/lib/commander/delegates.rb:12:in `run!'
    from /var/lib/gems/1.9.1/gems/commander-4.1.6/lib/commander/import.rb:10:in `block in <top (required)>'

And the tag used:

{% picture [] img/posts/2014-03-06-first-classd-amp/IMG_1395.jpg [source_key: img/posts/2014-03-06-first-classd-amp/IMG_1395.jpg] [attribute="value"] %}

Version

maziarzamani commented 10 years ago

I just noticed that another issue is related to mine, although running a different version of Ruby: https://github.com/robwierzbowski/jekyll-picture-tag/issues/27

robwierzbowski commented 10 years ago

Could it be an undefined preset? This has been a problem from the start. I think the plugin needs to be re-architected to have improved error handling.