Create Your Personal Website Using GitHub Pages#
Introduction#
GitHub Pages is a static site hosting service that allows you to host Markdown files, HTML files, or other static content on GitHub for free. With GitHub Pages, you can create personal blogs, project showcase pages, or company homepages, and more. This article will guide you on how to quickly set up a simple personal website using GitHub Pages.
Steps#
1. Create a New GitHub Repository#
First, log in to your GitHub account and click on the +
button in the top right corner, then select New repository
.
- Repository name: It is recommended to use the format
<your-username>.github.io
so that GitHub Pages can work properly. - Public/Private: Choose public or private repository based on your needs. Public repositories can be accessed by anyone, while private repositories require authorization.
- Description: Briefly describe the purpose of your repository.
- Initialize: You can choose whether to initialize the repository, add a
.gitignore
file, and a LICENSE file.
Once created, you will be taken to the main page of the repository.
2. Add Content#
GitHub Pages supports various static site generators such as Jekyll, Hugo, etc. Here, we will use the simplest example of a Markdown file.
- Create a file named
index.md
in the root directory of the repository. - Edit the
index.md
file and add some basic Markdown content. For example:
---
title: My Personal Website
---
# Welcome to my personal website!
This is the platform where I share programming knowledge and personal projects.
## About Me
I am a software engineer specializing in web development and data science.
## Latest Projects
- [Project A](#)
- [Project B](#)
## Contact Information
You can reach me through the following channels:
- Email: [email protected]
- Twitter: @example
- Save and commit the changes.
3. Configure GitHub Pages#
- Go to the
Settings
page of the repository. - Scroll down to the
GitHub Pages
section. - Select
main
branch (or any other branch you want to deploy from) from theSource
dropdown menu. - Choose a
Theme
from the available options that suits the style of your website. - Click on the
Save
button to save the configuration.
4. View the Result#
Once the configuration is complete, GitHub Pages will automatically deploy your website. You can find the URL of your website in the GitHub Pages
section, usually in the format https://<your-username>.github.io
.
Advanced Tips#
Custom Domain#
If you want to use a custom domain, you can add a CNAME record in the Settings
page of the repository and point the domain to the URL provided by GitHub.
Using Jekyll or Hugo#
If you want to use more powerful static site generators, you can use Jekyll or Hugo. GitHub Pages supports Jekyll by default, just create a _config.yml
file in the root directory of the repository and configure the relevant parameters.
Conclusion#
With GitHub Pages, you can easily create and publish your own personal website. Whether it's a simple blog or a complex corporate website, GitHub Pages is a very useful tool. Hopefully, this article will help you get started with GitHub Pages and create your own website.