sondr3 / generator-jekyllized

A Yeoman generator for Jekyll to rapidly build sites using Gulp
MIT License
326 stars 35 forks source link

On saving page only regenerates once #132

Closed joshuarule closed 8 years ago

joshuarule commented 8 years ago

Tried to set up a site today and kept running into something i'm not sure how to resolve. It seems when running running either gulp or gulp --prod I can save a change to a file once and then my site will no longer regenerate.

I'm getting this in the console which i'm not really sure how to make sense of and was hoping you might have an idea where to look

Configuration file: _config.yml
Configuration file: _config.build.yml
               Source: src
         Destination: dist
Incremental build: disabled. Enable with --incremental
      Generating...
                    done in 0.17 seconds.
Auto-regeneration: disabled. Use --watch to enable.
sondr3 commented 8 years ago

Not sure either, what OS and version of Node and such are you running? Haven't seen anything like this for a long, long while.

joshuarule commented 8 years ago

I'm on OSX 10.11.4, Node v4.4.3, Ruby 2.0.0p648.

sondr3 commented 8 years ago

Would it be possible for you to try this in Ruby 2.3 and Node 6?

grshane commented 8 years ago

I am having the same issue. Mine will regenerate scss changes but not any changes to html files. OSX 10.11.4 Node 6 Ruby 2.3.1.

peepshow commented 8 years ago

Ditto. OSX 10.11.4, Node v4.2.6, Ruby 2.0.0

Content or template edits only inject once on save. SCSS does continue to update on save however.

sondr3 commented 8 years ago

Bah, strange. Haven't seen this myself before. I'll look into it.

sondr3 commented 8 years ago

I think something has changes with how gulp watches files/runs commands. I'm looking into it but due to exams I have very little time until the end of May.

joshuarule commented 8 years ago

I just upgraded and had similar results.

nsocrates commented 8 years ago

A temporary fix for this would be to do a manual reload.

gulp.watch(['src/**/*.md', 'src/**/*.html', 'src/**/*.yml'], gulp.series('jekyll')).on('change', reload)

gulp.watch('src/assets/images/**/*').on('change', reload)

sondr3 commented 8 years ago

Yeah, I used to do that but I think it's not technically correct and has some strange behavior. But I might just revert to it.

peepshow commented 8 years ago

@nsocrates thank you very much, that works fine for now. Much appreciated.

wihodges commented 8 years ago

I'm having this problem too. The gulp file modification sorta works but having to save multiple times before its refreshes.

sondr3 commented 8 years ago

You can change your gulpfile to what was posted below, it'll work. Just to confirm, it's only for HTML and markdown it's not working?

wihodges commented 8 years ago

Yea just HTML

mitchrenton commented 8 years ago

I'm having the same problem with the page changes only regenerating once.

I also get the following warning, seems related...

WARN: Unresolved specs during Gem::Specification.reset: listen (< 3.1, ~> 3.0) WARN: Clearing out unresolved specs.

sondr3 commented 8 years ago

That error usually comes from Jekyll being upgraded and having older gems in your system. Try to clean out old gems.

mitchrenton commented 8 years ago

Thanks for the tip there. I've actually reverted Jekyll to 3.0.5 and cleared out older gems. Here's my gem list now...

activesupport (4.2.6) addressable (2.4.0) bigdecimal (1.2.6) bundler (1.12.3) chunky_png (1.3.4) classifier-reborn (2.0.4) coffee-script (2.4.1) coffee-script-source (1.10.0) colorator (0.1) compass (1.0.3) compass-core (1.0.3) compass-import-once (1.0.5) ethon (0.9.0) execjs (2.6.0) faraday (0.9.2) fast-stemmer (1.0.2) ffi (1.9.10) gemoji (2.1.0) github-pages (78) github-pages-health-check (1.1.0) html-pipeline (2.4.0) i18n (0.7.0) io-console (0.4.3) jekyll (3.0.5) jekyll-archives (2.1.0) jekyll-coffeescript (1.0.1) jekyll-feed (0.5.1) jekyll-gist (1.4.0) jekyll-github-metadata (1.11.1) jekyll-mentions (1.1.2) jekyll-paginate (1.1.0) jekyll-redirect-from (0.10.0) jekyll-sass-converter (1.3.0) jekyll-seo-tag (1.4.0) jekyll-sitemap (0.10.0) jekyll-textile-converter (0.1.0) jekyll-watch (1.4.0) jemoji (0.6.2) json (1.8.3, 1.8.1) kramdown (1.10.0) liquid (3.0.6) listen (3.0.6) mercenary (0.3.6) mini_portile2 (2.0.0) minitest (5.8.4) multi_json (1.11.0) multipart-post (2.0.0) net-dns (0.8.0) nokogiri (1.6.7.2) octokit (4.3.0) power_assert (0.2.2) psych (2.0.8) public_suffix (1.5.3) rake (10.4.2) rb-fsevent (0.9.7) rb-inotify (0.9.7) rdiscount (2.1.8) rdoc (4.2.0) redcarpet (3.3.4) RedCloth (4.2.9) rouge (1.10.1) safe_yaml (1.0.4) sass (3.4.22) sawyer (0.7.0) terminal-table (1.5.2) test-unit (3.0.8) thread_safe (0.3.5) typhoeus (0.8.0) tzinfo (1.2.2)

I actually deleted some of the newer version of gems I had that weren't in line with the github pages dependency versions .

Now I have an error Could not find jekyll-sass-converter-1.4.0 in any of the sources (Bundler::GemNotFound) which is looking for a newer version of the jekyll-sass-converter that my 1.3.0 version. When I update that gem, it updates all of the dependencies and I'm out of sync with GitHub pages jekyll dependencies again.

Any ideas what to do here?

sondr3 commented 8 years ago

Not really, I'd force clean all your gems and reinstall. That's what I usually do, nuke it from orbit :smile:

mitchrenton commented 8 years ago

I'll give it a shot. I just noticed my local grunt CLI version is 1.2.1. Is that right?

sondr3 commented 8 years ago

Grunt? I hope you meant gulp :P I haven't actually looked at the version of that since I switched to gulp 4.0.

mitchrenton commented 8 years ago

Haha, sorry yes, I meant Gulp. So I nuked my gems, and re-installed, and that has removed any errors. I still only get the regeneration on the first page change though I'm afraid.

sondr3 commented 8 years ago

Yeah, I'm in the middle of my exams so I won't have time to fix it until next weekend in afraid :)

mitchrenton commented 8 years ago

No problem. Good luck with your exams!

RomanHotsiy commented 8 years ago

The reason is here: https://github.com/gulpjs/gulp/issues/1626#issuecomment-215992824

I've fixed this by creating function:

function doRealod(done) {
  reload();
  done();
}

and using it instead of reload:

gulp.watch(['src/**/*.md', 'src/**/*.html', 'src/**/*.yml'], gulp.series(log, 'jekyll', doReload));
// ....
gulp.watch('src/assets/images/**/*', doReload);
sondr3 commented 8 years ago

Yeah, I saw this pop up on the 'gulp' repo yesterday as a pull request on how to use Gulp 4 with BrowserSync. Thanks though! 😃

sondr3 commented 8 years ago

I've pushed a new version of jekyllized to NPM, you can update your settings with yo jekyllized:gulp [--rsync|amazon|pages] after you've updated to the latest version of jekyllized (npm install -g generator-jekyllized@next), but beware that it'll ask you to overwrite your package.json and gulpfile so back them up. From what I can see this works as it should on my end now, but if it doesn't please let me know! 😄