GitHub Pages
GitHub Pages is a static site hosting service that takes HTML, CSS, and JavaScript files straight from a repository on GitHub, optionally runs the files through a build process, and publishes a website.
Table of Contents
Public GitHub Pages repository
To create GitHub Pages repository, follow the instructions:
- Log in to your GitHub account.
- Then click New at the top left of the screen.
-
In the specified field, type the name of the repository. For GitHub Pages, you have to name your repository according to the scheme my_username.github.io.
-
Select Public.
📝 Note: For GitHub Pages, you need to make the repository public.
- Click Create repository.
Adding files to GitHub Pages repository
- Open your GitHub Pages repository in VS Code.
- In the top menu click File.
- Select New File.
- Name the file as index.html.
- Write any content in HTML.
- Save the file.
- To add the file to GitHub, open GitHub Desktop.
- Select a repository from the list.
- Go into Changes.
- If the change summary name did not automatically generate, type the name in the space specified.
- Select Commit to master.
- Then select Publish branch.
- To check if your web page works, go into browser.
- In the web browser type the name of your GitHub Pages repository: my_username.github.io.