Personal webpage on Github - The complete guide

published on 06 November 2023

Introduction

A personal website is a great way to establish your online presence and share your work, thoughts, and experiences with the world. As more people and employers search online to learn about individuals, having your own personal site can be invaluable.

GitHub Pages has exploded in popularity as a platform for easily hosting personal sites. By leveraging GitHub's powerful version control and web hosting capabilities, you can quickly create and publish a professional personal website for free without needing to know any web development.

This comprehensive guide aims to walk through the entire process from start to finish, equipping complete beginners with no coding experience to build their own site on GitHub Pages. We'll cover account setup, creating a repository, configuring GitHub Pages, adding site content, custom domains, search engine optimization, and launching your live personal webpage. Let's get started!

Setting Up a GitHub Account

Since your website files will be hosted in a GitHub repository, the first step is to create a free GitHub account if you don't already have one.

Head to github.com and sign up for a new account. Verify your email address and choose an appropriate username - this will become part of your site's URL so make it professional. You can change it later if needed but the URL will also change.

For enhanced security, enable two-factor authentication (2FA). 2FA requires you to enter a generated code from an authenticator app or SMS when logging in, proving identity. Using an authenticator app like Authy is more secure than SMS 2FA. The minor hassle is worth the protection against unauthorized account access.

Choosing a Username

Your GitHub username will be publicly visible and double as part of your website's URL, so choose wisely! Keep it simple, professional, and inoffensive - this represents your personal brand. Avoid using your real name or anything inappropriate.

Check availability before finalizing your username. You can change it later if needed but your website URL will also change, so best to decide early.

Securing Your Account

Since your website repo will be public, securing your GitHub account is crucial. Enable two-factor authentication (2FA) for enhanced protection.

With 2FA enabled, you'll need to enter both your password and a six-digit code generated by an authenticator app or SMS when logging in. This verifies identity by requiring access to your password and physical device.

Use an authenticator app like Google Authenticator or Authy to generate 2FA codes rather than SMS codes, which are more susceptible to interception. Download the app, add your GitHub account, and scan the QR code shown under 2FA settings.

The minor hassle of 2FA is worth the security benefits of preventing unauthorized account access. Treat your GitHub account with care as you would any public online identity.

Creating a GitHub Repository

Once your GitHub account is ready, it's time to create a repository to store your website's source files. Repositories on GitHub can be public for the world to see, or private and only accessible to certain users. For a personal website, you'll want a public repo.

To create a new repository, log into GitHub and click the "+" icon in the top-right corner. Choose "New repository" and give it a clear name like yourusername.github.io, replacing "yourusername" with your actual GitHub username. Make sure it's public, add a README file, and click "Create repository".

Your website files will live in this new repo. The initialize with README option creates a starter file explaining the project - good practice when starting a new repository!

Configuring GitHub Pages

Now that you have an empty repository, let's get your site live on the web! This is made possible by GitHub Pages.

GitHub Pages is a free static web hosting service that hosts websites directly from GitHub repositories, automatically publishing new commits live. This allows you to easily deploy and update sites without needing separate hosting.

There are two types of GitHub Pages sites: Project Pages and User/Organization Pages. Since you're building a personal site, you'll use a User Page which is tied to your user account rather than a specific project repository.

To enable GitHub Pages on your new repo, head to "Settings", scroll down to "GitHub Pages", change the "Source" to your repo's main/master branch, and click "Save". It may take a few minutes for your site to be live at https://yourusername.github.io. Congrats, you're now hosting on GitHub Pages!

See the GitHub Pages documentation for more details on configuring and advanced usage. Your site's content will live in the repo and automatically publish to https://yourusername.github.io.

Adding Site Content

Your website is now up and running, though it doesn't contain anything yet. Let's fix that! The content for your GitHub Pages site will live in your repository as files.

Start by creating an index.html file. This will serve as the homepage for your site. Add some basic HTML like:

<!DOCTYPE html> 
<html>
  <head>
    <title>Your Name - Homepage</title>
  </head>
  
  <body>
    <h1>Hi, I'm Your Name!</h1>  
    
    <p>Welcome to my website!</p> 
  </body>
</html>

Keep the markup minimal for now. You can also create an about.html page, contact.html, blog.html, or anything else you want to include.

For the homepage, consider adding a short bio, links to social profiles, featured projects, recent blog posts, an email newsletter sign up form, and more. The about page could share your story, skills, experience, education, and interests.

A contact page is handy for providing ways for visitors to get in touch, like an email address, contact form, social profiles, etc. Blog and portfolio pages demonstrate your work.

Structuring Your Site

As your site grows, you'll want to organize all the files properly. Here is a common structure:

  • / (root folder)
  • index.html
  • README.md
  • /pages
  • about.html
  • blog.html
  • contact.html
  • /assets
  • /css
  • styles.css
  • /js
  • script.js
  • /images
  • logo.png

Put your page HTML files inside a /pages folder to keep things tidy. Have a header and footer HTML snippet that gets included on each page for consistent nav and branding. Keep assets like CSS, JS, and images separate in an assets folder.

For examples of clean GitHub Pages structures, check out pages.github.com and jekyllthemes.io.

Adding Site Styling

Plain HTML is functional but boring. Spice up your site's look by adding some CSS! Create a styles.css file with site-wide styles and link it in the `` of your HTML:

<link rel="stylesheet" href="/assets/css/styles.css">  

Some default CSS might look like:

body {
  font-family: Arial;
  margin: 0;
  padding: 0; 
}

h1, h2, h3 {
  color: #333;
}

p {
  line-height: 1.5;
}

For quick styling, use a GitHub Pages theme. For advanced customization, use Sass, CSS frameworks, etc. Tools like Tailwind CSS make styling easy.

Committing and Pushing Changes

As you build your site, you'll need to regularly commit changes to your local Git repository and push them to GitHub to deploy live.

Git is a version control system that tracks changes to your project over time. Make commits with descriptive messages summarizing the updates. When ready, push commits from your local repo to GitHub to reflect changes there.

Ensure GitHub Pages is enabled on the main/master branch of your repo for automatic deployment on push. Commits pushed to this branch will go live on your site shortly after.

Customizing and Improving Your Site

Now you have a fully functioning site on GitHub Pages! Here are some tips for improvements and customization:

  • Add a custom color scheme and branding that matches your personality. Consider tools like Coolors for palettes.
  • Populate your site with custom text, images, projects, and blog posts. Make the content your own!
  • Buy a custom domain and configure it with GitHub Pages for a professional URL. Unicorn Platform provides free custom domains with their startup plans.
  • Optimize your content for search engines by using relevant keywords, quality content, and speed optimizations. Minify code, compress images, and cache assets.
  • Build backlinks by having reputable sites link back to your content. Produce shareable content that readers want to reference.
  • Create a sitemap.xml and robots.txt file for crawlers. Follow SEO best practices.
  • Add forms for email newsletter signups, contact forms, etc using tools like Unicorn Platform's built-in form builder.
  • Include social sharing buttons to encourage readers to share your pages.

Stay up to date on the latest web design trends and SEO best practices for an optimal site. The web is always evolving.

Custom Domain Setup

Using the default github.io subdomain is fine, but buying your own custom domain allows for a more professional URL and brand.

Popular domain registrars include GoDaddy, Google Domains, Namecheap, etc. Look for affordable .com, .net, .org options. Once purchased, configure DNS settings with your registrar to point the domain to your GitHub Pages URL.

GitHub has docs on setting up a custom domain. Take care not to enable custom domains on multiple GitHub Pages sites, as this can cause issues.

For side projects and personal sites, RecommendedDomains.com is a great option with domains starting at $9 per year.

Search Engine Optimization

Search engine optimization (SEO) helps your site show up higher in search results. With some simple practices, you can improve visibility and discoverability:

  • Include relevant keywords in page titles, headers, URL slugs, alt text, and content. Research target keywords.
  • Create useful, high quality content that answers questions and provides value to readers. Engaging, shareable content ranks well.
  • Optimize site speed by minifying code, compressing images, using a CDN, and caching assets. Test site performance with Lighthouse.
  • Build backlinks by having reputable, relevant sites link back to your content naturally. Guest post on industry blogs.
  • Create and submit a sitemap.xml to search engines. Update it as your site grows.
  • Use strategic internal linking between related content. Link relevant pages together.

Stay up to date on the latest SEO best practices for optimal search ranking. SEO is constantly evolving. Tools like Moz and Ahrefs provide actionable guidance.

Launching Your Personal Site!

Congratulations, you've now successfully built and launched a personal website using GitHub Pages!

In this guide, you created a GitHub account, initialized a repository, configured GitHub Pages, added site content, customized the design, implemented SEO practices, and deployed everything live.

Announce your slick new site on social media and start sharing your work with the world! As you continue developing your site, engage your visitors by regularly adding new blog posts, portfolio pieces, resources, and updates over time.

Your GitHub Pages site is your corner of the web - take ownership and showcase your unique skills, experiences, and personality. The possibilities are endless.

For anyone looking to easily build a fast, modern website without coding, tools like Unicorn Platform provide intuitive drag and drop site builders tailored for startups and entrepreneurs. Be sure to check them out!

Happy coding and site building!

Related posts

Read more

Make your website with
Unicorn Platform Badge icon