pcouy / jekyll-picture-tag-ng

Transparently generate and use alternative picture sizes
https://pierre-couy.dev/projects/jekyll-picture-tag-ng.html
MIT License
4 stars 0 forks source link

Configuration should work with default values #1

Closed erikw closed 1 year ago

erikw commented 1 year ago

Hey, first thanks for this cool plugin. It looks like exactly what I need!

I installed the Gem, added it to the Jekyll plugins configuration and on jekyll build I get:

~/.local/share/asdf/installs/ruby/3.1.0/lib/ruby/gems/3.1.0/gems/jekyll-picture-tag-ng-0.6.0/lib/jekyll-picture-tag-ng/jekyll/site.rb:11:in write': undefined method[]' for nil:NilClass (NoMethodError)

  if config["picture_tag_ng"]["parallel"]
                             ^^^^^^^^^^^^
    from ~/.local/share/asdf/installs/ruby/3.1.0/lib/ruby/gems/3.1.0/gems/jekyll-4.3.2/lib/jekyll/site.rb:82:in `process'
    from ~/.local/share/asdf/installs/ruby/3.1.0/lib/ruby/gems/3.1.0/gems/jekyll-4.3.2/lib/jekyll/command.rb:28:in `process_site'
    from ~/.local/share/asdf/installs/ruby/3.1.0/lib/ruby/gems/3.1.0/gems/jekyll-4.3.2/lib/jekyll/commands/build.rb:65:in `build'
    from ~/.local/share/asdf/installs/ruby/3.1.0/lib/ruby/gems/3.1.0/gems/jekyll-4.3.2/lib/jekyll/commands/build.rb:36:in `process'
    from ~/.local/share/asdf/installs/ruby/3.1.0/lib/ruby/gems/3.1.0/gems/jekyll-4.3.2/lib/jekyll/command.rb:91:in `block in process_with_graceful_fail'

If I add the default configuration from the README to the jekyll config, it does work!

It would be much nicer if the plugin worked by using default values. If one needs to change from default, then one could start adding the config :)

pcouy commented 1 year ago

You are absolutely right, I just published an updated version that should fix this (https://github.com/pcouy/jekyll-picture-tag-ng/commit/8fe29e73bc266244e2533681e47572787a6a8713, v0.6.1)

Thank you for taking the time to try the plugin and report the issue.