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

Jekyll removes generated images every time #40

Closed pruzicka closed 10 years ago

pruzicka commented 10 years ago

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

robwierzbowski commented 10 years ago

Can you paste the relevant parts of the Gruntfile?

pruzicka commented 10 years ago

So I've tried different syntax and I've managed to add generated_images to clean section, so they do not disappear from 'dist', i.e. grunt build. So far so good. Now question is - what about grunt serve ? Could re-use the same images for serve task ? ".jekyll" directory is always wiped clean. Thanks

Petr

   clean: {
      dist: {
        files: [{
          dot: true,
          src: [
          '<%= yeoman.dist %>/*',
            // Running Jekyll also cleans the target directory.  Exclude any
            // non-standard `keep_files` here (e.g., the generated files
            // directory from Jekyll Picture Tag).
          '!<%= yeoman.dist %>/generated_images',
          '!<%= yeoman.dist %>/.git*'
]
}]
},
robwierzbowski commented 10 years ago

Can you try:

      server: [
        '.tmp',
        '.jekyll',
        '!.jekyll/generated_images'
      ]
pruzicka commented 10 years ago

No result unfortunately :(

pruzicka commented 10 years ago

so as workaround I did server: [ '.tmp', //'.jekyll', '.jekyll/blog', '.jekyll/assets' .... ]

which is super bad pattern, but for now it speeds up my workflow by 100% :)

robwierzbowski commented 10 years ago

Nice. I will get to testing this but I don't want to spend finite time on it now when the rewrites I have in the works may alleviate the problem. Thanks for keeping up with the issue and posting back your findings.

On Wednesday, June 4, 2014, pruzicka notifications@github.com wrote:

so as workaround I did server: [ '.tmp', //'.jekyll', '.jekyll/blog', '.jekyll/assets' .... ]

which is super bad pattern, but for now it speeds up my workflow by 100% :)

— Reply to this email directly or view it on GitHub https://github.com/robwierzbowski/jekyll-picture-tag/issues/40#issuecomment-45151206 .

Rob Wierzbowski @robwierzbowski http://twitter.com/#!/robwierzbowski http://github.com/robwierzbowski http://robwierzbowski.com

pruzicka commented 10 years ago

Yup, I understand. I'm just surprised that I'm the only one with this problem :)

pruzicka commented 10 years ago

Well, so here is the solution... Problem was matching patterns. Done, case closed :)

server: [ '.tmp', '.jekyll/*', '!.jekyll/generated_images/**' ],

robwierzbowski commented 10 years ago

YAYYYYYYYY

High fives.

On Wednesday, June 4, 2014, pruzicka notifications@github.com wrote:

Well, so here is the solution... Problem was matching patterns. Done, case closed :)

server: [ '.tmp', '.jekyll/ _', '!.jekyll/generatedimages/*' ],

— Reply to this email directly or view it on GitHub https://github.com/robwierzbowski/jekyll-picture-tag/issues/40#issuecomment-45155418 .

Rob Wierzbowski @robwierzbowski http://twitter.com/#!/robwierzbowski http://github.com/robwierzbowski http://robwierzbowski.com