This guide explains how to run your GitHub Pages site offline on your local machine using Jekyll. Follow these steps to edit and preview your site in real-time.
gem install jekyll bundler
your-username
and your-repository-name
with your details:
git clone https://github.com/your-username/your-repository-name.git
cd your-repository-name
Run the following command in your repository directory to install the required gems:
bundle install
To start a local server for your site, use the command:
bundle exec jekyll serve
After running the above command, Jekyll will provide a local address, typically:
http://127.0.0.1:4000
Open this URL in your browser to preview your site.
Jekyll automatically detects changes in your files and rebuilds the site. Simply refresh your browser to see the updates.
To stop the local server, press Ctrl+C
in the terminal where the server is running.
gem install bundler
4000
) is in use, specify a different port:
bundle exec jekyll serve --port 5000
Your GitHub Pages site is now running offline. You can edit and preview your changes seamlessly!