GitHub Pages is a fantastic way to host your Jekyll blog for free. In this post, I’ll walk you through the process of setting up GitHub Pages with your Jekyll site.

Setting Up GitHub Pages

Step 1: Create a GitHub Repository

First, create a new repository on GitHub. You can name it anything you like, but if you want it to be accessible at username.github.io, name it exactly that.

Step 2: Push Your Jekyll Site

Once you’ve created the repository, push your Jekyll site files to GitHub:

git add .
git commit -m "Initial Jekyll blog setup"
git branch -M main
git remote add origin https://github.com/username/username.github.io.git
git push -u origin main

Step 3: Enable GitHub Pages

  1. Go to your repository settings
  2. Scroll down to the “Pages” section
  3. Under “Source”, select “Deploy from a branch”
  4. Choose the “main” branch and “/ (root)” folder
  5. Click “Save”

Custom Domain (Optional)

If you have a custom domain, you can configure it:

  1. Add a CNAME file to your repository root with your domain name
  2. Configure your domain’s DNS settings to point to GitHub Pages

Automatic Deployment

GitHub Pages will automatically rebuild your site whenever you push changes to your repository. This means you can write posts locally and simply push them to see them live!

Conclusion

GitHub Pages makes it incredibly easy to host a Jekyll blog. The combination of Jekyll’s simplicity and GitHub Pages’ free hosting creates a powerful platform for bloggers and developers alike.

Happy blogging!