Github Pages Jekyll Example

Ann Jul 09, 2026

GitHub Pages, a static site hosting service, is a powerful tool for showcasing your projects, portfolios, and even personal websites. Jekyll, a popular static site generator, is often used in conjunction with GitHub Pages to create dynamic, content-rich sites. Here, we'll explore a GitHub Pages Jekyll example, guiding you through the process of creating and deploying a Jekyll site.

Get Started With GitHub Pages (Plus Bonus Jekyll)
Get Started With GitHub Pages (Plus Bonus Jekyll)

Before we dive in, ensure you have Git installed on your local machine. If not, you can download it from the official Git website. Once installed, you're ready to create your Jekyll site and deploy it to GitHub Pages.

GitHub Profile
GitHub Profile

Setting Up Your Jekyll Site

To start, you'll need to install Jekyll on your local machine. Open your terminal or command prompt and run the following command to install Jekyll and Bundler (a dependency manager for Ruby):

an image of a web page with the words get started with github pages
an image of a web page with the words get started with github pages

gem install jekyll bundler

Creating a New Jekyll Site

Build A Blog With Jekyll And GitHub Pages — Smashing Magazine
Build A Blog With Jekyll And GitHub Pages — Smashing Magazine

Now, let's create a new Jekyll site. Navigate to the directory where you want to create your site and run:

jekyll new my-site

Replace 'my-site' with the name you want for your site. Jekyll will create a new folder with your site's name and set up the basic structure.

an image of a computer screen with some type of programming program on it's side
an image of a computer screen with some type of programming program on it's side

Understanding the Site Structure

Your new site will have the following structure:

  • my-site - The root directory of your site.
  • _config.yml - The configuration file for your site. Here, you can set global variables like the site's title, baseurl, and markdown settings.
  • _layouts - Contains layout files that define the overall structure of your pages.
  • _includes - Contains reusable snippets of code, like headers and footers.
  • _posts - Contains your blog posts. Jekyll uses the date in the filename to display posts in chronological order.
  • index.md - The homepage of your site. You can create additional pages by adding new markdown files in the root directory.
How to Upload Jekyll to Github Page
How to Upload Jekyll to Github Page

Customizing Your Jekyll Site

Now that you have a basic understanding of your site's structure, let's customize it. Open the _config.yml file and update the site's title and baseurl:

the computer screen with an error message on it that reads, copplot command - line interface
the computer screen with an error message on it that reads, copplot command - line interface
Thura Lin Htut Developer GitHub Profile
Thura Lin Htut Developer GitHub Profile
GitHub - dec0dOS/amazing-github-template: 🚀 Useful README.md, LICENSE, CONTRIBUTING.md, CODE_OF_CONDUCT.md, SECURITY.md, GitHub Issues, Pull Requests and Actions templates to jumpstart your projects.
GitHub - dec0dOS/amazing-github-template: 🚀 Useful README.md, LICENSE, CONTRIBUTING.md, CODE_OF_CONDUCT.md, SECURITY.md, GitHub Issues, Pull Requests and Actions templates to jumpstart your projects.
a black and white drawing of a man in a top hat with a woman behind him
a black and white drawing of a man in a top hat with a woman behind him
How to Add Your Recently Published Medium Articles to Your GitHub Readme
How to Add Your Recently Published Medium Articles to Your GitHub Readme
How to Host Your Blog for Free with Jekyll and GitHub Pages - Make Tech Easier
How to Host Your Blog for Free with Jekyll and GitHub Pages - Make Tech Easier
rentry inspo
rentry inspo
Jekyll cheat sheet · Web Dev Topics · Learn the Web
Jekyll cheat sheet · Web Dev Topics · Learn the Web
a drawing of a man with an evil look on his face and hair, wearing a suit
a drawing of a man with an evil look on his face and hair, wearing a suit
How to Showcase Your GitHub Project the Right Way
How to Showcase Your GitHub Project the Right Way
Explore Masterjudah's Open Source Code Portfolio on GitHub 👨‍💻
Explore Masterjudah's Open Source Code Portfolio on GitHub 👨‍💻
I know what you are, Jekyll… 👀
I know what you are, Jekyll… 👀
two black and white typefaces with the word jekylynder written on them
two black and white typefaces with the word jekylynder written on them
the poster for dr jekyll and mr hyde is shown in black and white
the poster for dr jekyll and mr hyde is shown in black and white
★ DR HENRY JEKYLL ICON
★ DR HENRY JEKYLL ICON
GitHub - AndrejGajdos/List-of-Free-Online-Tools-For-Front-end-Web-Development: :bookmark: [2020] List of free online tools and resources in form of web applications or web services for front-end development. Each tool contains a short description with a .gif preview or a webpage screenshot.
GitHub - AndrejGajdos/List-of-Free-Online-Tools-For-Front-end-Web-Development: :bookmark: [2020] List of free online tools and resources in form of web applications or web services for front-end development. Each tool contains a short description with a .gif preview or a webpage screenshot.
Utterson
Utterson
GitHub - bobbyiliev/introduction-to-git-and-github-ebook: Free Introduction to Git and GitHub eBook
GitHub - bobbyiliev/introduction-to-git-and-github-ebook: Free Introduction to Git and GitHub eBook
Jekyll and Hyde
Jekyll and Hyde
Jekyll and Hyde: The Dual Nature of Man
Jekyll and Hyde: The Dual Nature of Man

title: My Site

baseurl: "/my-site"

Creating a New Post

To create a new post, navigate to the _posts directory and create a new markdown file. Name it using the following format: YYYY-MM-DD-title.md. For example, 2022-01-01-welcome-to-my-site.md.

Open the file and add the following front matter at the top:

--- layout: post title: "Welcome to My Site" date: 2022-01-01 00:00:00 +0000 categories: jekyll update ---

Then, add your post content below the front matter. Jekyll will use the front matter to display the post's title, date, and categories.

Building and Serving Your Site Locally

To build and serve your site locally, navigate to the root directory of your site and run:

bundle exec jekyll serve

Jekyll will build your site and start a local server. Open your web browser and visit http://localhost:4000 to view your site.

Deploying Your Site to GitHub Pages

Now that your site is set up and running locally, let's deploy it to GitHub Pages.

Pushing Your Site to GitHub

First, initialize a new Git repository in your site's root directory:

git init

Then, add, commit, and push your changes to a new repository on GitHub:

git add .

git commit -m "Initial commit"

git remote add origin https://github.com/yourusername/your-repo-name.git

git push -u origin main

Configuring GitHub Pages

Once your site is pushed to GitHub, navigate to your repository's settings page. Scroll down to the "Pages" section and select the branch you want to use for GitHub Pages (usually 'main' or 'master'). Click "Save".

GitHub will now build and deploy your site. You can view it by visiting https://yourusername.github.io/your-repo-name/.

Congratulations! You've successfully created and deployed a Jekyll site to GitHub Pages. Now you can start adding more content, customizing your site's design, and exploring the many features Jekyll has to offer. Happy coding!