niveus / jekyll-srcset

Dead simple responsive images for jekyll
MIT License
3 stars 1 forks source link

Unknown tag `image_tag` #1

Open Etheryte opened 4 years ago

Etheryte commented 4 years ago

I get the following error upon building:

Error: A Liquid tag in the excerpt of foo.md couldn't be parsed.
Error: could not read file foo.md: undefined method `ancestors' for nil:NilClass
Liquid Exception: Liquid syntax error (line 1): Unknown tag 'image_tag' in foo.md

Installing both this plugin's predecessor gem and this one seems to solve the issue:

group :jekyll_plugins do
  gem "jekyll-srcset"
  gem "jekyll-srcset2"
end

Then the tag is found and different sizes are generated as expected.

My gemfile uses Github pages (gem "github-pages", group: :jekyll_plugins) and I initiate the plugin in _config.yml as follows:

plugins:
  - jekyll-srcset

The problem probably stems from the way my setup is done, but I'm not familiar enough with Ruby to figure it out. Since the above solution works for me, I hope it can help anyone else who comes across it.

niveus commented 4 years ago

You shouldn't need to include the original gem. Make sure you have a srcset config in your _config.yml file.

srcset:
  optipng: true
  cjpeg: true
  cache: "/tmp/images"
  jpeg_quality: 50

and use the original name to load the plugin:

plugins:
...
  - jekyll-srcset