Git Product home page Git Product logo

jekyll_picture_tag's People

Contributors

benkoshy avatar btobolaski avatar egelmex avatar elstudio avatar everlag avatar extua avatar illis avatar intrinseca avatar ivalentine avatar johnfmorton avatar joshfriend avatar justinxreese avatar kaarliscaune avatar kremalicious avatar loksland avatar m8mble avatar marvelxy avatar mattdsteele avatar mattisg avatar philrb avatar raphaelfeng avatar razor-x avatar rbuchberger avatar stevenmassaro avatar tobias-fischer avatar user-none avatar vaheder avatar williamdodson avatar zerotraceme avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jekyll_picture_tag's Issues

Fails if generated folder is not empty

steps to reproduce:

touch assests/images/generated/index.html
picture:
  source: "assets/images/_fullsize"
  output: "assets/images/generated"
  markup: "picturefill"

expected behaviour:
assets/images/generated should contain images and index.html

observed behaviour:
assets/images/generated only contains index.html

Caption in <picture> tag

Is there a way to define a caption within the <picture> tag?
Like <picture>…<p>Caption</p></picture>

Build error

My _config.yaml

# PLUGINS
gems: [jekyll-picture-tag]

# JEKYLL PICTURE TAG SETTINGS
picture:
  source: "img/posts"

Usage

{% picture IS-A.png %}

Error

Liquid Exception: undefined method `[]' for nil:NilClass in _posts/2015-05-25-object-oriented-design.md
/Library/Ruby/Gems/2.0.0/gems/jekyll-picture-tag-0.2.3/lib/jekyll-picture-tag.rb:43:in `render': undefined method `[]' for nil:NilClass (NoMethodError)
    from /Library/Ruby/Gems/2.0.0/gems/liquid-2.6.2/lib/liquid/block.rb:109:in `block in render_all'
    from /Library/Ruby/Gems/2.0.0/gems/liquid-2.6.2/lib/liquid/block.rb:96:in `each'
    from /Library/Ruby/Gems/2.0.0/gems/liquid-2.6.2/lib/liquid/block.rb:96:in `render_all'
    from /Library/Ruby/Gems/2.0.0/gems/liquid-2.6.2/lib/liquid/block.rb:82:in `render'
    from /Library/Ruby/Gems/2.0.0/gems/liquid-2.6.2/lib/liquid/template.rb:128:in `render'
    from /Library/Ruby/Gems/2.0.0/gems/liquid-2.6.2/lib/liquid/template.rb:138:in `render!'
    from /Library/Ruby/Gems/2.0.0/gems/jekyll-2.5.3/lib/jekyll/convertible.rb:106:in `render_liquid'
    from /Library/Ruby/Gems/2.0.0/gems/jekyll-2.5.3/lib/jekyll/convertible.rb:233:in `do_layout'
    from /Library/Ruby/Gems/2.0.0/gems/jekyll-2.5.3/lib/jekyll/post.rb:261:in `render'
    from /Library/Ruby/Gems/2.0.0/gems/jekyll-2.5.3/lib/jekyll/site.rb:298:in `block in render'
    from /Library/Ruby/Gems/2.0.0/gems/jekyll-2.5.3/lib/jekyll/site.rb:297:in `each'
    from /Library/Ruby/Gems/2.0.0/gems/jekyll-2.5.3/lib/jekyll/site.rb:297:in `render'
    from /Library/Ruby/Gems/2.0.0/gems/jekyll-2.5.3/lib/jekyll/site.rb:51:in `process'
    from /Library/Ruby/Gems/2.0.0/gems/jekyll-2.5.3/lib/jekyll/command.rb:28:in `process_site'
    from /Library/Ruby/Gems/2.0.0/gems/jekyll-2.5.3/lib/jekyll/commands/build.rb:56:in `build'
    from /Library/Ruby/Gems/2.0.0/gems/jekyll-2.5.3/lib/jekyll/commands/build.rb:34:in `process'
    from /Library/Ruby/Gems/2.0.0/gems/jekyll-2.5.3/lib/jekyll/commands/build.rb:18:in `block (2 levels) in init_with_program'
    from /Library/Ruby/Gems/2.0.0/gems/mercenary-0.3.5/lib/mercenary/command.rb:220:in `call'
    from /Library/Ruby/Gems/2.0.0/gems/mercenary-0.3.5/lib/mercenary/command.rb:220:in `block in execute'
    from /Library/Ruby/Gems/2.0.0/gems/mercenary-0.3.5/lib/mercenary/command.rb:220:in `each'
    from /Library/Ruby/Gems/2.0.0/gems/mercenary-0.3.5/lib/mercenary/command.rb:220:in `execute'
    from /Library/Ruby/Gems/2.0.0/gems/mercenary-0.3.5/lib/mercenary/program.rb:42:in `go'
    from /Library/Ruby/Gems/2.0.0/gems/mercenary-0.3.5/lib/mercenary.rb:19:in `program'
    from /Library/Ruby/Gems/2.0.0/gems/jekyll-2.5.3/bin/jekyll:20:in `<top (required)>'
    from /usr/bin/jekyll:23:in `load'
    from /usr/bin/jekyll:23:in `<main>'

Can anyone please correct me where I am wrong?

P.S: A proper example would be of great help as I am not a Ruby developer.

Allow build to continue with missing images.

I'm currently building a site that will feature a large gallery section. I don't currently have all the images in place and when I run jekyll build this causes the build to fail with the error message that it can't find the images. It would be nice if the error message was shown but allowed building to continue.

Very slow build times

Has anyone had any issues with very slow build times? I'm looking at about 6 seconds with only 1 article (26 images) and with my full site (only around 15 articles) its almost 15 minutes. I've narrowed it down to the picture tag plugin but beyond that I don't know.

Any ideas?

http://jameseilers.com

Lack of media attribute on default fails W3C validation

Hello!

The W3C validator expects a media/type attribute on every srcset, otherwise you get the following error:

A source element that has a following sibling source element or img element with a srcset attribute must have a media attribute and/or type attribute.

It fails due to the fact that the default source doesn't accept this parameter, and therefore doesn't output the attribute.

Maybe default it to...

media="(min-width: 0)"

Cheers,
Dave

If no width/height is set in a source plugin crashes.

If you forgot to include a width/height in a image source config Jekyll fails with an unhelpful exception.

      Generating...   Liquid Exception: undefined method `[]' for nil:NilClass in _posts/2008-10-19-hello-world.html
/home/me92/tinkersoc/_plugins/picture_tag.rb:95:in `block in render': undefined method `[]' for nil:NilClass (NoMethodError)
    from /home/me92/tinkersoc/_plugins/picture_tag.rb:94:in `each'
    from /home/me92/tinkersoc/_plugins/picture_tag.rb:94:in `render'

Liquid exception: No such file or directory

Keep getting the following Liquid exception when trying to use this plugin:

Liquid Exception: No such file or directory - identify in _posts/2013-10-13-test.md

Meanwhile, in my test post I'm using the simplest possible version of the tag:

{% picture a-test.jpg %}

Relevant part of config as follows (lifted directly from project example):

pygments: true
markdown: redcarpet

picture:
  source: bucket
  output: bucket/generated
  markup: picturefill
  presets:
    # Full width pictures
    default:
      ppi: [1, 1.5]
      attr:
        class: blog-full
        itemprop: image
      source_lrg:
        media: "(min-width: 40em)"
        width: 700
      source_med:
        media: "(min-width: 30em)"
        width: 450
      source_default:
        width: 350
        height: 200

The source image is definitely in the /bucket directory.

Hoping this is just some simple, bone-headed oversight on my part, but could use a hand chasing it down. Thanks!

Debugging extra <p>{::nomarkdown} ... {:/}</p>

I'm new to jekyll-picture-tag, but I have it successfully generating images and inserting markup. The problem is that I'm left with an extra <p>{::nomarkdown} ... {:/}</p> wrapping my image spans. I've attached an example below.

What could be causing the error? Or rather, what part of the toolchain is responsible for removing those extra tags.

I am using redcarpet 2.3.0 and jekyll 1.4.3.

<p>{::nomarkdown}
<span class="article-img-full" itemprop="image" data-picture data-alt="Set of custom Field Notes" >
<span data-src="/generated/fieldnotes/set-320*200-8f6b49.png"></span>
<span data-src="/generated/fieldnotes/set-480*300-8f6b49.png" data-media="(-webkit-min-device-pixel-ratio: 1.5), (min-resolution: 144dpi)"></span>
<span data-src="/generated/fieldnotes/set-640*400-8f6b49.png" data-media="(-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi)"></span>
<span data-src="/generated/fieldnotes/set-500*333-8f6b49.png" data-media="(min-width: 17em)"></span>
<span data-src="/generated/fieldnotes/set-750*500-8f6b49.png" data-media="(min-width: 17em) and (-webkit-min-device-pixel-ratio: 1.5), (min-width: 17em) and (min-resolution: 144dpi)"></span>
<span data-src="/generated/fieldnotes/set-1000*666-8f6b49.png" data-media="(min-width: 17em) and (-webkit-min-device-pixel-ratio: 2), (min-width: 17em) and (min-resolution: 192dpi)"></span>
<noscript>
<img src="/generated/fieldnotes/set-320*200-8f6b49.png" alt="Set of custom Field Notes">
</noscript>
</span>
{:/}</p>

JPG Quality Setting?

I don't know if I'm missing something, but is there an option to set the JPG quality of the generated files?

One pager

The plugin needs a one page github pages site. Paging @xiwcx.

...

Or should I say one paging @xiwcx.

Generated folder contains images multiple times after multiple site generations

My config looks like this:

# Image-Tag presets
image:
  source: assets/images/
  output: generated
  presets:
    # Proportional preset
    default:
      width: 720

After running jekyll generate multiple times, each image appears multiple times in the generated folder.

Example:

incident-695x309-ae81c8.png
incident-695x309-af4c36.png
incident-695x309-b489a5.png
incident-695x309-ba62f1.png
incident-695x309-bebd5e.png
incident-695x309-bfefe2.png
incident-695x309-c4b627.png

I thought the regeneration might delete the old images or better reuse the images it already resized! What am I doing wrong? This takes a lot of generation time and a lot of space on my webserver.

Add more control of what gets cropped when width and height are set.

Use case:
Provide widescreen, normal, and narrow images for desktop, tablet, phone.

syntax:
crop-x: {left, right, both}
crop-y: {left, right, both}
width: W
height: H

if crop-x, crop-y are not set: resize as usual.
if one is set: resize by other dimension then apply crop.
if both are set don't resize just crop.

Can the image path contain spaces?

Hello,

I have picture tag working well, but it seems to throw an error if the path to the image contains spaces. Is there any way around this?

Here is the liquid tag I am using:

{% picture thumb {{file.path}} %}

When file.path is path/to/file.jpg it works. When is it path to file.jpg i get the following error:

Liquid Exception: undefined method `[]' for nil:NilClass in .site/layouts/index.html
<PATH REDACTED>/.site/plugins/picture_tag.rb:43:in `render': undefined method `[]' for nil:NilClass (NoMethodError)
    from /Users/jamesking/.rvm/gems/ruby-2.0.0-p353/gems/liquid-2.6.2/lib/liquid/block.rb:109:in `block in render_all'
    from /Users/jamesking/.rvm/gems/ruby-2.0.0-p353/gems/liquid-2.6.2/lib/liquid/block.rb:96:in `each'
    from /Users/jamesking/.rvm/gems/ruby-2.0.0-p353/gems/liquid-2.6.2/lib/liquid/block.rb:96:in `render_all'
    from /Users/jamesking/.rvm/gems/ruby-2.0.0-p353/gems/liquid-2.6.2/lib/liquid/tags/if.rb:40:in `block (2 levels) in render'
    from /Users/jamesking/.rvm/gems/ruby-2.0.0-p353/gems/liquid-2.6.2/lib/liquid/tags/if.rb:38:in `each'
    from /Users/jamesking/.rvm/gems/ruby-2.0.0-p353/gems/liquid-2.6.2/lib/liquid/tags/if.rb:38:in `block in render'
    from /Users/jamesking/.rvm/gems/ruby-2.0.0-p353/gems/liquid-2.6.2/lib/liquid/context.rb:112:in `stack'
    from /Users/jamesking/.rvm/gems/ruby-2.0.0-p353/gems/liquid-2.6.2/lib/liquid/tags/if.rb:37:in `render'
    from /Users/jamesking/.rvm/gems/ruby-2.0.0-p353/gems/liquid-2.6.2/lib/liquid/block.rb:109:in `block in render_all'
    from /Users/jamesking/.rvm/gems/ruby-2.0.0-p353/gems/liquid-2.6.2/lib/liquid/block.rb:96:in `each'
    from /Users/jamesking/.rvm/gems/ruby-2.0.0-p353/gems/liquid-2.6.2/lib/liquid/block.rb:96:in `render_all'
    from /Users/jamesking/Documents/SP+EE/Projects/DIU-citizen-science-platform/3. Deliverables/.site/plugins/directory_tag.rb:94:in `block (2 levels) in render'
    from /Users/jamesking/Documents/SP+EE/Projects/DIU-citizen-science-platform/3. Deliverables/.site/plugins/directory_tag.rb:62:in `each'
    from /Users/jamesking/Documents/SP+EE/Projects/DIU-citizen-science-platform/3. Deliverables/.site/plugins/directory_tag.rb:62:in `each_with_index'
    from /Users/jamesking/Documents/SP+EE/Projects/DIU-citizen-science-platform/3. Deliverables/.site/plugins/directory_tag.rb:62:in `block in render'
    from /Users/jamesking/.rvm/gems/ruby-2.0.0-p353/gems/liquid-2.6.2/lib/liquid/context.rb:112:in `stack'
    from /Users/jamesking/Documents/SP+EE/Projects/DIU-citizen-science-platform/3. Deliverables/.site/plugins/directory_tag.rb:61:in `render'
    from /Users/jamesking/.rvm/gems/ruby-2.0.0-p353/gems/liquid-2.6.2/lib/liquid/block.rb:109:in `block in render_all'
    from /Users/jamesking/.rvm/gems/ruby-2.0.0-p353/gems/liquid-2.6.2/lib/liquid/block.rb:96:in `each'
    from /Users/jamesking/.rvm/gems/ruby-2.0.0-p353/gems/liquid-2.6.2/lib/liquid/block.rb:96:in `render_all'
    from /Users/jamesking/.rvm/gems/ruby-2.0.0-p353/gems/liquid-2.6.2/lib/liquid/block.rb:82:in `render'
    from /Users/jamesking/.rvm/gems/ruby-2.0.0-p353/gems/liquid-2.6.2/lib/liquid/template.rb:128:in `render'
    from /Users/jamesking/.rvm/gems/ruby-2.0.0-p353/gems/liquid-2.6.2/lib/liquid/template.rb:138:in `render!'
    from /Users/jamesking/.rvm/gems/ruby-2.0.0-p353/gems/jekyll-2.5.3/lib/jekyll/convertible.rb:106:in `render_liquid'
    from /Users/jamesking/.rvm/gems/ruby-2.0.0-p353/gems/jekyll-2.5.3/lib/jekyll/convertible.rb:205:in `render_all_layouts'
    from /Users/jamesking/.rvm/gems/ruby-2.0.0-p353/gems/jekyll-2.5.3/lib/jekyll/convertible.rb:239:in `do_layout'
    from /Users/jamesking/.rvm/gems/ruby-2.0.0-p353/gems/jekyll-2.5.3/lib/jekyll/page.rb:122:in `render'
    from /Users/jamesking/.rvm/gems/ruby-2.0.0-p353/gems/jekyll-2.5.3/lib/jekyll/site.rb:298:in `block in render'
    from /Users/jamesking/.rvm/gems/ruby-2.0.0-p353/gems/jekyll-2.5.3/lib/jekyll/site.rb:297:in `each'
    from /Users/jamesking/.rvm/gems/ruby-2.0.0-p353/gems/jekyll-2.5.3/lib/jekyll/site.rb:297:in `render'
    from /Users/jamesking/.rvm/gems/ruby-2.0.0-p353/gems/jekyll-2.5.3/lib/jekyll/site.rb:51:in `process'
    from /Users/jamesking/.rvm/gems/ruby-2.0.0-p353/gems/jekyll-2.5.3/lib/jekyll/command.rb:28:in `process_site'
    from /Users/jamesking/.rvm/gems/ruby-2.0.0-p353/gems/jekyll-2.5.3/lib/jekyll/commands/build.rb:56:in `build'
    from /Users/jamesking/.rvm/gems/ruby-2.0.0-p353/gems/jekyll-2.5.3/lib/jekyll/commands/build.rb:34:in `process'
    from /Users/jamesking/.rvm/gems/ruby-2.0.0-p353/gems/jekyll-2.5.3/lib/jekyll/commands/serve.rb:26:in `block (2 levels) in init_with_program'
    from /Users/jamesking/.rvm/gems/ruby-2.0.0-p353/gems/mercenary-0.3.5/lib/mercenary/command.rb:220:in `call'
    from /Users/jamesking/.rvm/gems/ruby-2.0.0-p353/gems/mercenary-0.3.5/lib/mercenary/command.rb:220:in `block in execute'
    from /Users/jamesking/.rvm/gems/ruby-2.0.0-p353/gems/mercenary-0.3.5/lib/mercenary/command.rb:220:in `each'
    from /Users/jamesking/.rvm/gems/ruby-2.0.0-p353/gems/mercenary-0.3.5/lib/mercenary/command.rb:220:in `execute'
    from /Users/jamesking/.rvm/gems/ruby-2.0.0-p353/gems/mercenary-0.3.5/lib/mercenary/program.rb:42:in `go'
    from /Users/jamesking/.rvm/gems/ruby-2.0.0-p353/gems/mercenary-0.3.5/lib/mercenary.rb:19:in `program'
    from /Users/jamesking/.rvm/gems/ruby-2.0.0-p353/gems/jekyll-2.5.3/bin/jekyll:20:in `<top (required)>'
    from /Users/jamesking/.rvm/gems/ruby-2.0.0-p353/bin/jekyll:23:in `load'
    from /Users/jamesking/.rvm/gems/ruby-2.0.0-p353/bin/jekyll:23:in `<main>'
    from /Users/jamesking/.rvm/gems/ruby-2.0.0-p353/bin/ruby_executable_hooks:15:in `eval'
    from /Users/jamesking/.rvm/gems/ruby-2.0.0-p353/bin/ruby_executable_hooks:15:in `<main>'

Not sure if this is a bug or me doing something silly.

Thanks,

  • James

Output names causes incompatibility with windows

The change found here c5c70a9 to get around adblock also disables storing of images on a windows system due to the * which replaced the x.

I use virtualbox to build as I have to work in windows; The shared folder option allows me to write my site in windows and build it using ubuntu 12.04 so I can deploy it to a remote server. I started using this plugin and found that cp was returning a 'protocol error' due to the asterisk in the filename.

Jekll build command and image generation

Hi,

I've just got Picture Tag working on my Jekyll site and it's great! I have a question regarding the image generation process though.

Normall during development new images are compiled on the fly as a result of running jekyll serve -w. As part of my build process though, I'm running "jekyll build". It seems that Jekyll Picture Tag regenerates all images when using this command, even if the picture configuration options in _config.yaml havn't changed. I don't think I fully understand the problem so might be wrong here though.

Is this the correct/expected behaviour? I'd have thought that Picture Tag would only regenerate images for image sizes/ppi's which weren't already generated instead of regenerating ALL the images again.

I only have 10 or so screenshot images in my Jekyll site so far, but running jekyll build already takes over 10 minutes with 3 source sizes (2 custom and default) and 2 PPI's in _config.yaml.

Am I doing something wrong?

If it's useful my source is here

Thanks!

Error reading configuration. Syntax error.

I'm probably just ignorant, but I'm having issues with _config.yml

When I compile my site with the picture options indented as they should be, I get a syntax error. If I remove the indentation, it works except the "source" option conflicts with Jekyll's "source" option–rendering nothing but images in _site

name: Salted Lightly
description: A blog on philosophy, theology, and Christian living.
url: http://localhost:4000

permalink: pretty
markdown: redcarpet

exclude: [post_img]

picture:
    source: post_img
    output: /generated
    markup: "picturefill"
    presets:
        default:
            attr:
                class: "post-img"
            source_360:
                width: "360"
            source_720:
                width: "720"
                media: "(min-device-pixel-ratio: 1.5)"
            source_430:
                width: "430"
                media: "(min-width: 360px)"
            source_860:
                width: "860"
                media: "(min-width: 360px) and (min-device-pixel-ratio: 1.5)"
            source_500:
                width: "500"
                media: "(min-width: 430px)"
            source_1000:
                width: "1000"
                media: "(min-width: 430px) and (min-device-pixel-ratio: 1.5)"
            source_640:
                width: "640"
                media: "(min-width: 500px)"
            source_1280:
                width: "1280"
                media: "(min-width: 500px) and (min-device-pixel-ratio: 1.5)"
        articleimg:
            attr:
                class: "post-img"
            source_360:
                width: "360"
            source_780:
                width: "780"
                media: "(min-device-pixel-ratio: 1.5)"
            source_470:
                width: "470"
                media: "(min-width: 360px)"
            source_940:
                width: "940"
                media: "(min-width: 360px) and (min-device-pixel-ratio: 1.5)"
            source_600:
                width: "600"
                media: "(min-width: 470px)"
            source_1200:
                width: "1200"
                media: "(min-width: 470px) and (min-device-pixel-ratio: 1.5)"
            source_780:
                width: "780"
                media: "(min-width: 600px)"
            source_1560:
                width: "1560"
                media: "(min-width: 600px) and (min-device-pixel-ratio: 1.5)"
            source_940:
                width: "940"
                media: "(min-width: 780px)"
            source_1840:
                width: "1840"
                media: "(min-width: 780px) and (min-device-pixel-ratio: 1.5)"
            source_1200:
                width: "1200"
                media: "(min-width: 940px)"
            source_2400:
                width: "2400"
                media: "(min-width: 940px) and (min-device-pixel-ratio: 1.5)"

Using in feeds

Apologies in advance, since this may not be the best forum for this, but I wanted to know how folks are dealing w/ Jekyll Picture Tag in their RSS feeds. Is there a straightforward way to keep the <picture> output from making it's way into post.content for feeds, or filtering it out somehow?

No context to render liquid when a picture tag is used in a _layout file

When I try to run Jekyll, I get Liquid Exception: undefined method[]' for nil:NilClass in post.html`

A traceback shows /Users/Bryan/Desktop/sl/_plugins/picture_tag.rb:42:inrender': undefined method []' for nil:NilClass (NoMethodError)

post.html is in my _layouts, I wonder if that is affecting it.

``html
{% include header.html %}

    {% picture articleimg {{ page.title }} alt="yep" %}

    <div class="wrapper">

        <article class="post">

            <header>
                <h1><a href="{{ page.url }}">{{ page.title }}</a></h1>
                <p><time datetime="{{ page.date | date: "%Y-%m-%d" }}">{{ page.date | date: "%B %d, %Y" }}</time></p>
                <p>By <a href="http://twitter.com/bryanbergman/" target="_blank">Bryan Bergman</a></p>
                <p>Reading time: <strong>{{ page.reading-time }}</strong></p>
            </header>

            {{ content }}

        </article>

        <div class="all"><a href="{{ site.url }}/archives">See all posts &rarr;</a></div>

    </div>

{% include footer.html %}

Unable to build

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

  • Ruby 1.9.1
  • Jekyll 1.4.3
  • liquid 2.5.5
  • commander 4.1.6
  • ImageMagick 6.7.7-10
  • redcarpet (3.1.1, 2.3.0)
  • mini_magick (3.7.0)

xHTML support

Should this plugin support xHTML? I wrote a fix for the Maruku parser, but I'm reluctant to include it. Personally I don't think the extra code weight and another _config.yml setting is worth it.

Liquid Exception: no such file or directory

I'm attempting to build my Jekyll project which will (I hope) use this picture tag plugin. I'm on Windows, latest Jekyll and latest version of the plugin.

When building I receive the following error:

Generating image-360by248-abcdefg.jpg
  Liquid Exception: No such file or directory - identify -ping C:/Users/user/AppData/Local/Temp/mini_magick20150829-8176-87razr.jpg in _drafts/some-draft.md
        done.

(I ran with --trace but it gave no more information.)

My picture configuration:

picture:
    source: "_img"
    output: "img"
    markup: "picture"
    presets:
        default:
            ppi: [1, 1.5, 2]
            attr:
                class: "post-image-medium"
                itemprop: "image"
            source_large:
                media: "(min-width: 720px)"
                width: "360"
            source_medium:
                media: "(min-width: 480px)"
                width: "180"
            source_default:
                width: "120"
        post_large:
            ppi: [1, 1.5, 2]
            attr:
                class: "post-image-large"
                itemprop: "image"
            source_large:
                media: "(min-width: 720px)"
                width: "720"
            source_medium:
                media: "(min-width: 480px)"
                width: "480"
            source_default:
                width: "320"
        post_small:
            ppi: [1, 1.5, 2]
            attr:
                class: "post-image-small"
                itemprop: "image"
            source_large:
                media: "(min-width: 720px)"
                width: "240"
            source_medium:
                media: "(min-width: 480px)"
                width: "120"
            source_default:
                width: "80"

The _drafts/some-draft.md has a simple picture tag used with:

{% picture directory/image.jpg %}

And jekyllsource/_img/directory/image.jpg exists. When jekyll serve --drafts --trace is used the destination directory (jekyllbuilt/img/directory) is created but no contents (images) appear inside it.

The error pops up and the generated draft page is an totally empty HTML file.

I installed the plugin using a Gemfile (bundle install) and I copied the raw jekyll-picture-tag.rb to the Jekyll plugins directory too.

Additional warns and notices in the output that I could find:

Unresolved specs during Gem::Specification.reset appears for redcarpet and listen.

Could these have anything to do with the error?

Specify fallback image

Does anyone care about IE8 support? Right now IE8 gets the default source (probably the smallest one), but if there's interest I could add a setting that lets you choose the source it receives.

Personally I'm happy to let IE8 be.

Add Support for Picturefill 2

Syntax has changed, notably the use of srcset in place of src:

<picture>
  <source srcset="examples/images/extralarge.jpg" media="(min-width: 1000px)">
  <source srcset="examples/images/large.jpg" media="(min-width: 800px)">
  <source srcset="examples/images/medium.jpg">
  <img srcset="examples/images/medium.jpg" alt="A giant stone face at The Bayon temple in Angkor Thom, Cambodia">
</picture>

error on build

I'm about 90% certain this is user error of some nature but I'm not a ruby programmer and I'm lost on debugging this. Thanks for creating what seems to be an much needed addon to Jekyll.

After installing this plugin and the necessary dependencies I receive this error on jekyll build

      Generating...   Liquid Exception: undefined method `[]' for nil:NilClass in _posts/2013-05-10-mypost.md /Users/ncl/Sites/mysite.jekyll/_plugins/picture_tag.rb:42:in `render': undefined method `[]' for nil:NilClass (NoMethodError)
    from /Users/ncl/.rvm/gems/ruby-2.1.0@global/gems/liquid-2.5.4/lib/liquid/block.rb:106:in `block in render_all'
    from /Users/ncl/.rvm/gems/ruby-2.1.0@global/gems/liquid-2.5.4/lib/liquid/block.rb:93:in `each'
    from /Users/ncl/.rvm/gems/ruby-2.1.0@global/gems/liquid-2.5.4/lib/liquid/block.rb:93:in `render_all'
    from /Users/ncl/.rvm/gems/ruby-2.1.0@global/gems/liquid-2.5.4/lib/liquid/block.rb:82:in `render'
    from /Users/ncl/.rvm/gems/ruby-2.1.0@global/gems/liquid-2.5.4/lib/liquid/template.rb:124:in `render'
    from /Users/ncl/.rvm/gems/ruby-2.1.0@global/gems/liquid-2.5.4/lib/liquid/template.rb:132:in `render!'
    from /Users/ncl/.rvm/gems/ruby-2.1.0/gems/jekyll-1.4.2/lib/jekyll/convertible.rb:88:in `render_liquid'
    from /Users/ncl/.rvm/gems/ruby-2.1.0/gems/jekyll-1.4.2/lib/jekyll/convertible.rb:150:in `do_layout'
    from /Users/ncl/.rvm/gems/ruby-2.1.0/gems/jekyll-1.4.2/lib/jekyll/post.rb:259:in `render'
    from /Users/ncl/.rvm/gems/ruby-2.1.0/gems/jekyll-1.4.2/lib/jekyll/site.rb:239:in `block in render'
    from /Users/ncl/.rvm/gems/ruby-2.1.0/gems/jekyll-1.4.2/lib/jekyll/site.rb:238:in `each'
    from /Users/ncl/.rvm/gems/ruby-2.1.0/gems/jekyll-1.4.2/lib/jekyll/site.rb:238:in `render'
    from /Users/ncl/.rvm/gems/ruby-2.1.0/gems/jekyll-1.4.2/lib/jekyll/site.rb:39:in `process'
    from /Users/ncl/.rvm/gems/ruby-2.1.0/gems/jekyll-1.4.2/lib/jekyll/command.rb:18:in `process_site'
    from /Users/ncl/.rvm/gems/ruby-2.1.0/gems/jekyll-1.4.2/lib/jekyll/commands/build.rb:23:in `build'
    from /Users/ncl/.rvm/gems/ruby-2.1.0/gems/jekyll-1.4.2/lib/jekyll/commands/build.rb:7:in `process'
    from /Users/ncl/.rvm/gems/ruby-2.1.0/gems/jekyll-1.4.2/bin/jekyll:77:in `block (2 levels) in <top (required)>'
    from /Users/ncl/.rvm/gems/ruby-2.1.0@global/gems/commander-4.1.5/lib/commander/command.rb:180:in `call'
    from /Users/ncl/.rvm/gems/ruby-2.1.0@global/gems/commander-4.1.5/lib/commander/command.rb:180:in `call'
    from /Users/ncl/.rvm/gems/ruby-2.1.0@global/gems/commander-4.1.5/lib/commander/command.rb:155:in `run'
    from /Users/ncl/.rvm/gems/ruby-2.1.0@global/gems/commander-4.1.5/lib/commander/runner.rb:402:in `run_active_command'
    from /Users/ncl/.rvm/gems/ruby-2.1.0@global/gems/commander-4.1.5/lib/commander/runner.rb:78:in `run!'
    from /Users/ncl/.rvm/gems/ruby-2.1.0@global/gems/commander-4.1.5/lib/commander/delegates.rb:7:in `run!'
    from /Users/ncl/.rvm/gems/ruby-2.1.0@global/gems/commander-4.1.5/lib/commander/import.rb:10:in `block in <top (required)>'

Any help would be greatly appreciated.

Liquid Exception: undefined method `[]' for nil:NilClass in _drafts/JekyllAnchors.md/#excerpt

When I try to use the picture tag I am constantly getting this error:

Liquid Exception: undefined method `[]' for nil:NilClass in _drafts/JekyllAnchors.md/#excerpt

Trace:

  Liquid Exception: undefined method `[]' for nil:NilClass in _drafts/JekyllAnchors.md/#excerpt
/home/vit/work/vrepinblog/_plugins/jekyll-picture-tag.rb:43:in `render': undefined method `[]' for nil:NilClass (NoMethodError)
    from /usr/lib64/ruby/gems/2.1.0/gems/liquid-2.6.2/lib/liquid/block.rb:109:in `block in render_all'
    from /usr/lib64/ruby/gems/2.1.0/gems/liquid-2.6.2/lib/liquid/block.rb:96:in `each'
    from /usr/lib64/ruby/gems/2.1.0/gems/liquid-2.6.2/lib/liquid/block.rb:96:in `render_all'
    from /usr/lib64/ruby/gems/2.1.0/gems/liquid-2.6.2/lib/liquid/block.rb:82:in `render'
    from /usr/lib64/ruby/gems/2.1.0/gems/liquid-2.6.2/lib/liquid/template.rb:128:in `render'
    from /usr/lib64/ruby/gems/2.1.0/gems/liquid-2.6.2/lib/liquid/template.rb:138:in `render!'
    from /usr/lib64/ruby/gems/2.1.0/gems/jekyll-2.5.3/lib/jekyll/convertible.rb:106:in `render_liquid'
    from /usr/lib64/ruby/gems/2.1.0/gems/jekyll-2.5.3/lib/jekyll/convertible.rb:233:in `do_layout'
    from /usr/lib64/ruby/gems/2.1.0/gems/jekyll-2.5.3/lib/jekyll/post.rb:258:in `render'
    from /usr/lib64/ruby/gems/2.1.0/gems/jekyll-2.5.3/lib/jekyll/site.rb:298:in `block in render'
    from /usr/lib64/ruby/gems/2.1.0/gems/jekyll-2.5.3/lib/jekyll/site.rb:297:in `each'
    from /usr/lib64/ruby/gems/2.1.0/gems/jekyll-2.5.3/lib/jekyll/site.rb:297:in `render'
    from /usr/lib64/ruby/gems/2.1.0/gems/jekyll-2.5.3/lib/jekyll/site.rb:51:in `process'
    from /usr/lib64/ruby/gems/2.1.0/gems/jekyll-2.5.3/lib/jekyll/command.rb:28:in `process_site'
    from /usr/lib64/ruby/gems/2.1.0/gems/jekyll-2.5.3/lib/jekyll/commands/build.rb:56:in `build'
    from /usr/lib64/ruby/gems/2.1.0/gems/jekyll-2.5.3/lib/jekyll/commands/build.rb:34:in `process'
    from /usr/lib64/ruby/gems/2.1.0/gems/jekyll-2.5.3/lib/jekyll/commands/build.rb:18:in `block (2 levels) in init_with_program'
    from /usr/lib64/ruby/gems/2.1.0/gems/mercenary-0.3.5/lib/mercenary/command.rb:220:in `call'
    from /usr/lib64/ruby/gems/2.1.0/gems/mercenary-0.3.5/lib/mercenary/command.rb:220:in `block in execute'
    from /usr/lib64/ruby/gems/2.1.0/gems/mercenary-0.3.5/lib/mercenary/command.rb:220:in `each'
    from /usr/lib64/ruby/gems/2.1.0/gems/mercenary-0.3.5/lib/mercenary/command.rb:220:in `execute'
    from /usr/lib64/ruby/gems/2.1.0/gems/mercenary-0.3.5/lib/mercenary/program.rb:42:in `go'
    from /usr/lib64/ruby/gems/2.1.0/gems/mercenary-0.3.5/lib/mercenary.rb:19:in `program'
    from /usr/lib64/ruby/gems/2.1.0/gems/jekyll-2.5.3/bin/jekyll:20:in `<top (required)>'
    from /usr/bin/jekyll:9:in `load'
    from /usr/bin/jekyll:9:in `<main>'

My source file has basically one line in the content section:

{% picture anchor.jpg %}

Jekyll version: 2.5.3

_config related to picture:

picture:
  source: "assets/imgs/_fullsize"
  output: "generated"
  markup: "picture"

I use redcarpet processor and re-define excerpt_separator.

No image displayed.

For some odd reason my images don't display. They're generated and exist when I browse to them directly but they don't show up on my site. See it live here: http://www.suchbrooklyn.com/

This is the generated code:

<p><span class="blog-full" itemprop="image" data-picture data-alt >
    <span data-src="/generated/wendys-350by200-871bb9.jpg"></span>
    <span data-src="/generated/wendys-525by300-871bb9.jpg" data-media="(-webkit-min-device-pixel-ratio: 1.5), (min-resolution: 144dpi)"></span>
    <span data-src="/generated/wendys-450by364-871bb9.jpg" data-media="(min-width: 30em)"></span>
    <span data-src="/generated/wendys-675by546-871bb9.jpg" data-media="(min-width: 30em) and (-webkit-min-device-pixel-ratio: 1.5), (min-width: 30em) and (min-resolution: 144dpi)"></span>
    <span data-src="/generated/wendys-700by566-871bb9.jpg" data-media="(min-width: 40em)"></span>
    <span data-src="/generated/wendys-960by776-871bb9.jpg" data-media="(min-width: 40em) and (-webkit-min-device-pixel-ratio: 1.5), (min-width: 40em) and (min-resolution: 144dpi)"></span>
    <noscript>
      <img src="/generated/wendys-350by200-871bb9.jpg" alt="">
    </noscript>
  </span></p>

This is the markdown:


---
layout: post
title: playing with images

---
how does this work?

{% picture zombies.jpg %}

{% picture wendys.jpg %}

Any support for background?

It seems that jekyll-asset have support for background image, though the resolution cannot adapt to screen resolution.

Issue with animated GIFs

I try to use this animated GIF in my content with the picture tag plugin
the-incredible-machine
:

Here is what the resize does:
the-incredible-machine-300by188-05d3ea

What would you suggest to fix this?

Thanks.

Get path for a particular size

It would be amazing if there were some built in functionality to ask for the path to a specific size of a generated image. There are various place where a <picture> tag doesn’t make sense (e.g. feeds, meta tags), but it seems a shame not to re-use already generated content. That’s not currently possible because the filename suffixes (WIDTHbyHEIGHT-etc) are unpredictable from outside of {% picture %}.

Could some kind of syntax along the lines of {% picture [preset] [source] path/to/img.jpg %} returning the path to the given source copy of the image work?

In any case, thanks for an already great plugin. ✋

Replace magick's convert by extent?

I stumbled upon a problem using this plugin and mini_magick whenever I was trying to create 100x100px sized images from original images smaller than 1200x800 pixels.

The resulting image would not be 100x100px, but 63x76px instead, due to some "magick" happening during the cropping process.

I have found that, when replacing crop by extent, it would work just fine (see the comment about -crop on http://www.imagemagick.org/Usage/resize/#fill). I'm not an imagemagick expert though, so there might be some other issues when doing this.

So the new code would be:

# Scale and crop
        image.combine_options do |i|
          i.resize "#{gen_width}x#{gen_height}^"
          i.gravity "center"
          i.extent "#{gen_width}x#{gen_height}+0+0"
        end

</span>

There is a closing span element being rendered directly after the image:

<noscript>
   <img src="/generated/leistungenplace-350*200-51eac9.png" alt="Leistungen" />;
</noscript>
<p></span></p>

Convert to tag with internal list content

If a picture tag is really long we should be able to break it into multiple lines for readability:

{% picture why_did_i_name_my_preset_this path/to/img.png 
     source_1: super/long/path/to/img.png
     source_2: super/long/path/to/another_img.png
     source_3: why/do/we/have/so/many/sources/img.png
     class="this makes it" alt="easier to read" itemprop="all these" data-damn-attributes
%}

Doesn't respect site.url

This plugin will not work if your site is not in the root of the server as site.url is not added to the image srcs.

div instead of span

I'm not sure if it's just my configuration, but I don't think Picturefill works with <span>. Maybe it would be better to replace them with <div>.

Build Fails w/ Picture Tag

I have all of the requirements installed, all of them work fine from the commands line, and your image-tag Jekyll plugin works fine.

I've included picturefill & matchmedia per the example, yet still when I build Jekyll I get the following error:
Liquid Exception: undefined method []' for nil:NilClass in _layouts/default.html`

From issues #33 & #27, I investigated my presents but, nothing!

Here's the liquid tag I'm using:

{% picture gallery f1-1-1900.jpg alt="Test" class="gal-test"  %}

Complete config:

title: 4g5 Test
baseurl: ""
url: "http://blahblah.4g5.com"
sass:
    style: :compressed
# Build settings
markdown: kramdown
highlighter: pygments
assets:
  dirname: assets/build
  baseurl: /assets/build/
  js_compressor: ~
  css_compressor: sass
  cache: false
  gzip: [ text/css, application/javascript ]
  debug: false
  version: 1

picture:
  source: assets/images/_fullsize
  output: img/generated
  markup: picturefill
  presets:
    gallery:
        ppi: [1, 1.5]
        attr:
        class: "gallery-pict"
        itemprop: "image"
        source_medium:
        media: "(min-width: 40em)"
        width: "600"
        height: "300"
        source_default: 
        width: "300"     

In terms of the trace, this is what I'm getting...

ubuntu@ip-10-47-138-109:~/f1$ jekyll build --trace
Configuration file: /home/ubuntu/f1/_config.yml
            Source: /home/ubuntu/f1
       Destination: /home/ubuntu/f1/_site
      Generating... 
  Liquid Exception: undefined method `[]' for nil:NilClass in _layouts/default.html
/home/ubuntu/f1/_plugins/picture_tag.rb:95:in `block in render': undefined method `[]' for nil:NilClass (NoMethodError)
    from /home/ubuntu/f1/_plugins/picture_tag.rb:94:in `each'
    from /home/ubuntu/f1/_plugins/picture_tag.rb:94:in `render'
    from /home/ubuntu/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/liquid-2.5.5/lib/liquid/block.rb:106:in `block in render_all'
    from /home/ubuntu/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/liquid-2.5.5/lib/liquid/block.rb:93:in `each'
    from /home/ubuntu/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/liquid-2.5.5/lib/liquid/block.rb:93:in `render_all'
    from /home/ubuntu/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/liquid-2.5.5/lib/liquid/block.rb:82:in `render'
    from /home/ubuntu/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/liquid-2.5.5/lib/liquid/template.rb:124:in `render'
    from /home/ubuntu/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/liquid-2.5.5/lib/liquid/template.rb:132:in `render!'
    from /home/ubuntu/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/jekyll-2.0.3/lib/jekyll/convertible.rb:96:in `render_liquid'
    from /home/ubuntu/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/jekyll-2.0.3/lib/jekyll/convertible.rb:142:in `render_all_layouts'
    from /home/ubuntu/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/jekyll-2.0.3/lib/jekyll/convertible.rb:176:in `do_layout'
    from /home/ubuntu/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/jekyll-2.0.3/lib/jekyll/post.rb:266:in `render'
    from /home/ubuntu/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/jekyll-2.0.3/lib/jekyll/site.rb:245:in `block in render'
    from /home/ubuntu/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/jekyll-2.0.3/lib/jekyll/site.rb:244:in `each'
    from /home/ubuntu/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/jekyll-2.0.3/lib/jekyll/site.rb:244:in `render'
    from /home/ubuntu/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/jekyll-2.0.3/lib/jekyll/site.rb:43:in `process'
    from /home/ubuntu/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/jekyll-2.0.3/lib/jekyll/command.rb:43:in `process_site'
    from /home/ubuntu/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/jekyll-2.0.3/lib/jekyll/commands/build.rb:46:in `build'
    from /home/ubuntu/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/jekyll-2.0.3/lib/jekyll/commands/build.rb:30:in `process'
    from /home/ubuntu/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/jekyll-2.0.3/lib/jekyll/commands/build.rb:17:in `block (2 levels) in init_with_program'
    from /home/ubuntu/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/mercenary-0.3.3/lib/mercenary/command.rb:220:in `call'
    from /home/ubuntu/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/mercenary-0.3.3/lib/mercenary/command.rb:220:in `block in execute'
    from /home/ubuntu/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/mercenary-0.3.3/lib/mercenary/command.rb:220:in `each'
    from /home/ubuntu/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/mercenary-0.3.3/lib/mercenary/command.rb:220:in `execute'
    from /home/ubuntu/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/mercenary-0.3.3/lib/mercenary/program.rb:35:in `go'
    from /home/ubuntu/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/mercenary-0.3.3/lib/mercenary.rb:22:in `program'
    from /home/ubuntu/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/jekyll-2.0.3/bin/jekyll:18:in `<top (required)>'
    from /home/ubuntu/.rbenv/versions/2.1.2/bin/jekyll:23:in `load'
    from /home/ubuntu/.rbenv/versions/2.1.2/bin/jekyll:23:in `<main>'

And heres my setup:

ruby 2.1.2p95
Rails 4.1.1
ImageMagick 6.8.9-4 Q16 x86_64
mini_magick 1.4.14

Jekyll removes generated images every time

Hi,
I use jekyll generator (https://github.com/robwierzbowski/generator-jekyllrb ) and picture-tag as well. Grunt server and grunt build would always clean ".jekyll" and "dist " directory, ie. also images in "generated_images" dir.
I've seen keep_files settings in _config.yml "keep_files: ['.git','.svn','.jpg']", also this in generator

Assign defaults

  settings['source'] ||= '.'
  settings['output'] ||= 'generated_images'
  settings['markup'] ||= 'picturefill'

  # Prevent Jekyll from erasing our generated files
  site.config['keep_files'] << settings['output'] unless site.config['keep_files'].include?(settings['output'])

I've added this line to clean: section task in grunt.js
'!<%= yeoman.dist %>/generated_images*'.

Nothing works. Is there any way how to not generate images in .jekyll & dist dir every time ?
Thanks a lot

Petr

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.