rubyjekylllivereload

Jekyll livereload not working for project initiated with --blank flag


I just started a fresh Jekyll project, with Ruby 3.3.0 and Jekyll 4.4.3.

I'm starting my local server with bundle exec jekyll serve --livereload, and the logs displays the line LiveReload address: http://127.0.0.1:35729.

But my page on the local server is not live reloading at all, nothing happens when I change the template / style / content. No error is thrown either. And all the topics I found online on the subject got an error to work with.

I have a (small) clue. I started this project with jekyll new project --blank, maybe the blank option is the culprit ? Something is needed in the project that I don't have ?

Edit 1:

I created another project without the --blank flag, and livereload is working. Thanks @bilal-younas for the tip.

Edit 2:

Just created an issue on the Jekyll repo : https://github.com/jekyll/jekyll/issues/9582


Solution

  • jekyll new --blank generates a minimal template setup, so less configuration or default plugins which a regular Jekyll site would have.

    Check your Gemfile of your minimal Jekyll project to ensure it includes the necessary gems for LiveReload to function, if they are not included, add the watch and livereload plugins:

    group :jekyll_plugins do
      gem "jekyll-watch"
      gem "jekyll-livereload"
    end
    

    Also ensure that your _config.yml file has the necessary settings for LiveReload:

    livereload: true