Step-by-Step Guide to Creating a Personal Blog with GitHub Pages and Jekyll
Step-by-Step Guide to Creating a Personal Blog with GitHub Pages and Jekyll
Welcome to my personal blog! This post is a detailed step-by-step guide to creating your own personal blog using GitHub Pages and Jekyll. Follow these steps carefully, and you’ll have your blog up and running in no time.
Steps to Create Your Blog
1. Fork the Jekyll Theme
- Visit the [https://github.com/cotes2020/chirpy-starter] repository.
- Click “Use this template” to create a new repository in your GitHub account.
- Name the repository
<your-username>.github.io
(replace<your-username>
with your GitHub username). - Click Create repository.
2. Configure Your Repository
- Open the
_config.yml
file in the repository. - Edit the following:
- URL:
1
url: "https://<your-username>.github.io"
- Title and Description:
1 2
title: "My Personal Blog" description: "A blog about coding, tech, and life."
- URL:
- Commit your changes with a meaningful message like “Updated blog configuration”.
3. Enable GitHub Pages
- Navigate to the Settings tab of your repository.
- Under Pages, select the
main
branch as the source. - Save the settings. Your blog will be live at:
1
https://<your-username>.github.io
4. Clone the Repository Locally
- Open a terminal or command prompt.
- Run the following commands:
1 2
git clone https://github.com/<your-username>/<your-username>.github.io.git cd <your-username>.github.io
5. Set Up Your Development Environment
- Install Ruby and Bundler:
- Ruby & Jekyll Installation: https://jekyllrb.com/docs/installation/
- Install Bundler:
1
gem install bundler
- Install project dependencies:
1
bundle
6. Run Your Blog Locally
- To preview your blog locally, start the Jekyll server:
1
bundle exec jekyll serve
- Open your browser and visit:
1
http://127.0.0.1:4000
7. Customize Your Blog
- Open the
_config.yml
file to make customizations:- Update the
title
,description
, andsocial links
. - Add an avatar image:
1
avatar: "<link-to-your-image>"
- Update the
8. Write Your First Blog Post
- Navigate to the
_posts
folder in your project directory. - Create a new markdown file with this format:
1
YYYY-MM-DD-title.md
- Add the following content:
1 2 3 4 5 6 7 8
--- layout: post title: "My First Blog Post" date: YYYY-MM-DD HH:MM:SS +0000 categories: [Example] tags: [Getting Started] --- Welcome to my blog! This is my first post.
- Save the file.
9. Push Changes to GitHub
- Stage and commit your changes:
1 2
git add . git commit -m "Added first blog post and customizations"
- Push your changes:
1
git push origin main
10. Enable LiveReload for Automatic Browser Updates
- Install the
jekyll-livereload
gem:1
gem install jekyll-livereload
- Add it to your
Gemfile
:1 2 3
group :jekyll_plugins do gem 'jekyll-livereload' end
- Install the gem via Bundler:
1
bundle install
- Run the server with LiveReload:
1
bundle exec jekyll serve --livereload
11. Optional: Use a Custom Domain
- Purchase a domain (e.g., from GoDaddy or Namecheap).
- Update the DNS settings:
- Add
A
records pointing to:1 2 3 4
185.199.108.153 185.199.109.153 185.199.110.153 185.199.111.153
- Add a
CNAME
record pointing to:1
<your-username>.github.io
- Add
- In GitHub repository settings, under Pages, add the custom domain.
Final Thoughts
Creating a personal blog using GitHub Pages and Jekyll is simple, cost-effective, and highly customizable. Follow these steps, and you’ll have a professional-looking blog in no time.
This post is licensed under CC BY 4.0 by the author.