Home Button
Back to Coding:

How I Built My Free Website

Here’s a step-by-step guide on how I created my free website using GitHub Pages and Visual Studio Code (VS Code). Follow these instructions to build your own!

Step 1: Create a Folder for Your Website

Start by creating a folder on your computer where you’ll store all the files for your website. For example, name it my_blog. This folder will hold your HTML, CSS, JavaScript, and any other assets needed for your site.


Step 2: Download Visual Studio Code

Download and install Visual Studio Code, a free and user-friendly code editor. Once installed, open VS Code and attach your folder:


Step 3: Download Git

Before setting up your GitHub repository, make sure you have Git installed on your computer. Git is a version control system that helps you manage your code and collaborate with others.

Download Git from the official website here!

Step 4: Create a New GitHub Repository

GitHub allows you to store and manage your code online, which is a lifesaver should you accidentally delete your code locally or mess up all your code trying to fix one bug.

GitHub is also essential for managing and hosting your website.


Step 5: Set Up Git Locally

Use your terminal to link your local folder to the GitHub repository:


Where is the terminal?

It'll be towards the bottom of the VS code editor, next to "problems", "output", "debug console".

picture of VS Code Editor with Terminal at the bottom

Step 6: Code Your Website

Create the necessary files for your website:

Tip:

Download the Live Server extension in VS Code so you can view your code changes in real time. This allows you to test and preview your website locally before pushing updates to GitHub.

For more detailed guidance, check out this article: How to Use Live Server in Visual Studio Code.


Step 7: Push Updates Regularly

As you code, remember to push the changes to GitHub to update your website:


Step 8: Publish with GitHub Pages

Host your website for free using GitHub Pages:

Your site will be live at https://username.github.io/repository_name.

Happy coding!