Are you a developer who wants to create a personal website or blog using a static site generator (SSG)? Jekyll, a popular choice among developers, can help you achieve this with impressive simplicity. By hosting your Jekyll site on GitHub Pages, you'll enjoy free, reliable, and fast hosting with an easy setup process. Let's explore how to set up Jekyll with GitHub Pages.

Before diving into the step-by-step guide, ensure you have Node.js installed on your system, as it's a prerequisite for both GitHub and Jekyll. If you haven't already, download and install Node.js from the official Node.js website. Once installed, you'll be ready to start your Jekyll GitHub Pages adventure.

Setting Up Your Local Environment
Now that you have Node.js installed, let's set up your local development environment for Jekyll.

First, you need to install Jekyll on your system. Since Jekyll is a Ruby gem, you can install it using the Ruby package manager, RubyGems. Open your terminal or command prompt and run the following command to install Jekyll:
Installing Jekyll

```bash gem install jekyll bundler ```
If you're using version 3 of Jekyll, you might need to install additional dependencies. Run the following bundle command to do so:
Installing Additional Dependencies (Jekyll 3)

```bash bundle update ```
With Jekyll successfully installed, it's time to create a new Jekyll site and start contributing your content to it.
Creating and Configuring Your Jekyll Site

Create a new directory for your Jekyll site and navigate to it in your terminal. Generate a new Jekyll site with the following command:
Generating a New Jekyll Site















![Create a Free Blog with Jekyll and GitHub Pages - [Step-by-Step Guide]](https://i.pinimg.com/originals/79/b7/0d/79b70d573849a58e22867094a3c5d1c5.png)



```bash jekyll new . --force ```
In the above command, we've used the `.` as the directory name. If you'd like a different name, replace `.` with your preferred directory name. The `--force` flag ensures that any existing content in this directory will be overwritten.
The `jekyll new` command will generate plenty of boilerplate code that you can use as a starting point. Now, let's configure your site by opening the `_config.yml` file in your text editor.
Configuring Your Jekyll Site
In the `_config.yml` file, you'll see sections for `url`, `baseurl`, `title`, and `markdown`. Customize these variables to match your site preferences:
- `url`: The base URL of your site, e.g., `https://yourusername.github.io`.
- `baseurl`: The subdirectory of your GitHub Pages repository, e.g., `/your-site-name`.
- `title`: The title of your website or blog.
- `markdown`: The markdown engine Jekyll uses to convert your content. The default is `kramdown`.
For example, if you want your site to be hosted at `https://yourusername.github.io/your-site-name`, your `_config.yml` file should look like this:
```yaml url: https://yourusername.github.io baseurl: /your-site-name title: Your Site Title markdown: kramdown ```
After configuring your site, you can start adding new content by creating new files in the `posts` directory or other collections within the `includes` folder.
Deploying Your Jekyll Site to GitHub Pages
Now that you have your local Jekyll site set up, it's time to deploy it to GitHub Pages. First, you need to initialize a new Git repository and commit your changes.
Initializing Git and Committing Changes
```bash git init git add . git commit -m "Initial commit" ```
Next, create a new repository on GitHub. Name it after your username (e.g., `yourusername.github.io`).
Pushing Your Changes to GitHub
Now, push your local repository to the newly created GitHub repository with the following commands:
git remote add origin https://github.com/yourusername/yourusername.github.io.git
git push -u origin master
Replace `yourusername` and `yourusername.github.io` with your actual GitHub username and repository name.
Within a few seconds, your Jekyll site should be live on GitHub Pages. To verify that everything works, open your browser and navigate to `https://yourusername.github.io`, replacing `yourusername` with your actual GitHub username.
And there you have it! Your custom Jekyll site is now hosted on GitHub Pages, ready to showcase your content to the world. Happy blogging!