Intro to Github Pages: Create a simple and free personal website (2024)

Anyone with or without coding experience can make a website for free

The world of web development can be insanely complex and overwhelming, however building a simple website doesn’t have to be difficult. Many people’s needs can be fulfilled simply by taking 30 minutes to set up a website on Github pages completely for free.

Power of Github Pages

Although the original purpose of Github Pages is to showcase a programmer’s work on Github, it can also be used for many other purposes.

  • Hosting a blog
  • a portfolio
  • a business landing page
  • an open letter

All these, and more, are possible through Github Pages, which has a soft-cap of 100 GB of bandwidth per month. On my blog, the average user uses about 612.43 KB of bandwidth per month, which means if my blog were hosted on Github Pages this soft-cap won’t be met until I have 163,284 monthly users. (This blog is hosted on Netlify, which will be another tutorial).

With Github Pages you have the option of

  1. simply write your content using Markdown files and use one of Github’s default themes, with the option of customization
  2. use a static site generator along with Github Actions, which has more customization and many templates to get you started
  3. or write HTML, CSS, and Javascript directly in Github

With this blog, I used a static site generator called “Hexo” which can also be used with Github Pages. However for this tutorial I will be showing you how to simply using one of Github’s provided themes:

Clicking through the links above, you might notice that many of the themes are designed to showcase a coding project, however with a bit of configuration, we can easily change them to fit many needs. Also, the first two themes, primer and minima, are a bit different from the other themes. Primer is the most simple theme and is basically just a single page, whereas Minima is a starter theme for building a blog. These two themes being a blank slate are a good place to start with if you want to build a website from the ground up.

Choosing a theme

The theme I will use for this tutorial is minimal because its two-column format is perfect for a personal portfolio website.

Intro to Github Pages: Create a simple and free personal website (1)

The [Logo] is a good spot for a picture of myself, and below that is space for links to my Github, my Linkedin, and my contact info. The column to the right is where I will list my skills, experience, projects, and resume.

Also, like all themes, this is totally customizable so I can add more things to the left column such as a graph showing which skills I’m best at.

Creating the website

Now let’s get started. First navigate to github.com and either log in or create an account if you don’t have one. Once you are logged in, click the “New” button to create a new repository:

Intro to Github Pages: Create a simple and free personal website (2)

Repository Name After this, you are brought to the “Create a new repository” page. If you wish your website to be hosted on the URL .github.io, then make this URL your repository (repo) name. Otherwise, the website will be hosted on .github.io/. (If you plan on purchasing your own domain, don’t worry too much about the name of your repo)

Description Some themes for Github Pages use the description, so fill in this field with a subtitle for your website. You can change this later.

Public / Private Select “Public” so that way you can host your website for free on Github Pages. This also means anyone can see the source code for your website, but this shouldn’t be too different from the content people can see on your website anyways.

The rest of the config on this page doesn’t matter too much, other than possibly choosing a license.

After clicking “Create repository” navigate to configure Github Pages with the instructions below:

Intro to Github Pages: Create a simple and free personal website (3)

  1. Click on “Settings”
  2. Click on “Pages”
  3. Select “main” branch
  4. Select / directory
  5. Click “Save”
  6. Choose theme (you can change this later)
  7. Optionally choose a custom domain to serve your website (you will need to buy and configure this domain from a website like domains.google. I won’t be going through how to configure a custom domain in this tutorial.)

After following these steps, you should see the message “Your site is published at “. Click on this URL and admire the beauty of your live website.

Modifying the website

Your repository should look like this now, with just a README.md file and a README.md file and a _config.yml file:

Intro to Github Pages: Create a simple and free personal website (4)

Modifying website content

Since an index.md file doesn’t exist, Github Pages uses README.md as the default entry-point for the website. This is where you can modify the contents of your website.

Click on the file README.md and then click the icon to edit the file.

This file is in Markdown format. Here is a quick guide to markdown.

You can click “ Preview” to see how your markdown will render before you submit. Once you are ready to see your changes live on your website, scroll to the bottom of the page and click “Commit changes” with the bubble checked “ Commit directly to the main branch.”

One cool thing about Markdown - you can write HTML directly within the markdown file. This is how I’m able to render the Github icons in this tutorial
. I copied the HTML for the icons from inspecting github.com with my browser, and pasted it directly into the Markdown file that is rendering this tutorial. This feature of Markdown makes it super flexible at building very custom webpages.

Choosing a different theme

Click on _config.yml. In this file you will see something like:

1
theme: jekyll-theme-...

For this tutorial I am using the “minimal” theme, so this is what my _config.yml looks like:

1
theme: jekyll-theme-minimal

You can change the theme here by modifying the line after theme: to reflect the name of the new theme, and then clicking “Commit changes” at the bottom of the page.

Customizing the theme

You can add other configuration to _config.yml depending on what your theme supports. The “minimal” theme behaves different for a repo with the name <username>.github.io than it does for a regular repo, where in this case it doesn’t show links to download the TAR or ZIP file and instead just links to the Github profile.

The README.md for the “Minimal” theme which you can read at the bottom of this page shows all instructions for how to customize this theme.

This is what my _config.yml looks like:

1
2
3
4
5
theme: jekyll-theme-minimal
title: Richard Barella
description: Software Engineer at Intel
logo: https://media-exp1.licdn.com/dms/image/C5603AQEjpWRtfGTu9Q/profile-displayphoto-shrink_800_800/0/1593112650172?e=1626307200&v=beta&t=_8iQKxnbGrZ3UbyAC1tOFfIV193I99dadgJh3pVN9DA
show_downloads: false

For the logo: part of _config.yml I added a link to my profile picture from Linkedin. To get the URL for this picture I right-clicked on the picture in my Linkedin and clicked “open in new tab”, and then the picture’s URL is shown in the new tab.

In addition, this theme supports google_analytics: ..., which you can use to help Google index your site faster for others to find your website from a Google search. To set this up, you need to set up a google analytics tracking id on analytics.google.com and insert this into your _config.yml.

After committing my changes to _config.yml, my website now looks like this:

Intro to Github Pages: Create a simple and free personal website (5)

As you can see it’s a good start, however there is some small things I would like to change. For example, I want my picture to be a circle, and I would like more links under “View My Github Profile” that link to my Linkedin and also my blog. These things can be changed by using the template provided by the theme and also creating my own style.scss file.

Customizing the theme’s style

For the theme’s style, my goal is simply to make my picture rounded rather than square. To do this, add a file to the repo called /assets/css/style.scss. The theme will automatically use this file to style your website.

When creating a new file, you can create it within the /assets/css/ folders by adding assets/css/ to the beginning of your filename.

Within this file, add this to the top:

1
2
3
---
---
@import "{{ site.theme }}";

After inspecting the HTML of my website at ribab.github.io, I noticed that the <img> for my profile image is located within the <header> element in the HTML. This means I can apply SCSS to only images within the <header> element through something like this: header { img { ... } }.

This is what my final scss file looks like:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
---
---
@import "{{ site.theme }}";
header {
img {
border-radius: 50%;
}
p {
text-align: center;
}
p.view {
text-align: left;
}
}

And voilà! I now have a circular icon for my profile picture, and also a centered description with the links staying left-aligned.

Intro to Github Pages: Create a simple and free personal website (6)

Customizing the theme’s template

To add more links to the left column on my webpage, I will need to customize the template for this theme.

  1. The first step is to navigate to the minimal theme’s _layouts/default.html file.
  2. Then create a new file _layouts/default.html in your repo and paste the contents of the theme’s layout file into the new file.
  3. Before the end of the <header> section (or before </header>), add links as you would like with the format: <p class="view"><a href="insert link URL here">Insert link text here</a></p>

This is what I added before </header>:

1
2
3
4
5
6
7
8
...

<p class="view"><a href="https://www.linkedin.com/in/richard-barella/">Visit my Linkedin Profile</a></p>

<p class="view"><a href="https://www.codingwithricky.com/">Checkout my blog</a></p>

</header>
...

Intro to Github Pages: Create a simple and free personal website (7)

Now we’re talking! My website (at ribab.github.io) now looks almost perfect. If I wanted to I could remove the Hosted on Github Pages – Theme by orderedlist text at the bottom by modifying the theme’s layout more, but this is good enough for me.

Conclusion

So this is how to use default theme’s in Github Pages to make your own websites completely for free. I plan to continue working on my own portfolio website and modify the README.md file to showcase all my work and experience. Now it’s time to get creative and make your very own website.

Happy coding!

Intro to Github Pages: Create a simple and free personal website (2024)

FAQs

Can you make a website with GitHub for free? ›

How to Host a Website on GitHub For Free?
  1. Github Login page.
  2. Create new repository.
  3. Name the repository as your username.github.io.
  4. Create new file.
  5. Create index.html and add the HTML code for your website.
  6. commit the HTML code.
  7. Create index.html and add the CSS code for your website.
  8. Commit the CSS code.
Jun 17, 2023

Are GitHub Pages good for a personal website? ›

In conclusion, if you're looking for a simple and affordable way to create a professional-looking personal website, I highly recommend using Github Pages. It's a quick and easy process that will allow you to showcase your skills, projects, and personality online.

How do I create a personal website on GitHub? ›

Creating your site
  1. On GitHub, navigate to your site's repository.
  2. Decide which publishing source you want to use. ...
  3. Create the entry file for your site. ...
  4. Configure your publishing source. ...
  5. Under your repository name, click Settings. ...
  6. In the "Code and automation" section of the sidebar, click Pages.

How many websites can I host on GitHub Pages for free? ›

You can only create one user or organization site for each account on GitHub. Project sites, whether owned by an organization or a personal account, are unlimited.

Is GitHub free for personal use? ›

GitHub offers free and paid plans for storing and collaborating on code. Some plans are available only to personal accounts, while other plans are available only to organization and enterprise accounts.

Is GitHub private free now? ›

GitHub announced the following plans and pricing changes: GitHub Free for organizations is immediately available and includes private repositories for unlimited users. All organizations previously using Team for Open Source now have GitHub Free. GitHub Free for individual developers now includes unlimited collaborators.

What are the downsides of GitHub Pages? ›

Limited customization: GitHub Pages uses Jekyll, a static site generator, which can be limiting if you want to do more advanced customization of your site. No support for server-side code: Because GitHub Pages generates static HTML files, you cannot use server-side languages like PHP or Ruby.

What are the limitations of GitHub Pages? ›

GitHub Pages sites are subject to the following usage limits:
  • GitHub Pages source repositories have a recommended limit of 1 GB.
  • Published GitHub Pages sites may be no larger than 1 GB.
  • GitHub Pages deployments will timeout if they take longer than 10 minutes.

Why not use GitHub Pages? ›

GitHub Pages is not intended for or allowed to be used as a free web-hosting service to run your online business, e-commerce site, or any other website that is primarily directed at either facilitating commercial transactions or providing commercial software as a service (SaaS).

How to host a website for free? ›

Here are some of the best sites for free web hosting:
  1. WordPress. WordPress is a free platform for creating and managing a blog. ...
  2. Weebly. Weebly is another free website builder that offers a free web hosting plan. ...
  3. Wix. ...
  4. GitHub Pages. ...
  5. Netlify. ...
  6. InfinityFree. ...
  7. 000webhost. ...
  8. AwardSpace.
Nov 20, 2023

How much does it cost to host a website on GitHub? ›

GitHub Pages is GitHub's answer to project pages, and it allows you to serve any static website straight from your repository. Since GitHub pages support custom domains, you can host a static website on GitHub pages free of charge, with deploys straight from Git.

Can I host my WordPress website on GitHub for free? ›

You can host your WordPress website on GitHub for free. This allows you to push your changes to your website directly from GitHub.

How much can you store on GitHub for free? ›

GitHub Team provides 2 GB of free storage. For any storage you use over that amount, GitHub will charge $0.008 USD per GB per day, or approximately $0.25 USD per GB for a 31-day month. That means the $50 spending limit you set will pay for an extra 200 GB of storage in that period.

How to host a static website on GitHub? ›

  1. Create a new GitHub repository. As mentioned above, we'll use GitHub Pages to host our static website. ...
  2. Clone the repository on your computer. ...
  3. Create a static website. ...
  4. Push your code to GitHub. ...
  5. Open your repository settings. ...
  6. Add a new page. ...
  7. Update your website.
Feb 28, 2022

Can I host dynamic website on GitHub for free? ›

Can GitHub host a dynamic website? No, GitHub cannot host dynamic websites. But you can utilise serverless backend to provide dynamic features. Example of serverless backend services are Google Firebase, AWS API Gateway, MongoDB Stitch etc.

Top Articles
Latest Posts
Article information

Author: Prof. An Powlowski

Last Updated:

Views: 6308

Rating: 4.3 / 5 (64 voted)

Reviews: 95% of readers found this page helpful

Author information

Name: Prof. An Powlowski

Birthday: 1992-09-29

Address: Apt. 994 8891 Orval Hill, Brittnyburgh, AZ 41023-0398

Phone: +26417467956738

Job: District Marketing Strategist

Hobby: Embroidery, Bodybuilding, Motor sports, Amateur radio, Wood carving, Whittling, Air sports

Introduction: My name is Prof. An Powlowski, I am a charming, helpful, attractive, good, graceful, thoughtful, vast person who loves writing and wants to share my knowledge and understanding with you.