Live reload local Jekyll site in browser on file changes
The other day, I was looking for a way using which I can reload my local Jekyll instance every time I make some changes into the files.
So, I dig through the following
--help command hoping to find if something in-built is there or not,
$ jekyll serve --help
And fortunately, there was an option called
--livereload) which can do exactly the same as I wanted which is to detect file changes and live reloading the browser instance.
As you may guess, all we need to do is append the
-l option to
jekyll serve command like so.
$ jekyll serve -l
And it will automatically reload your local Jekyll site in the browser every time you make changes in files.
You can further couple the
--open-url) option which will launch your site in your browser automatically.
$ jekyll serve -l -o
👋 Hi there! I'm Amit. I write articles about all things web development. If you like what I write and want me to continue doing the same, I would like you buy me some coffees. I'd highly appreciate that. Cheers!