GitHub Pages

If you want to show people what you build, one of the easiest way to publish your code as a website is using GitHub Pages. Simply create a new repository. Add all the files you need for your website. Make sure when copying over files from your existing project the the paths to your libraries are correct. If you are not sure and your project is not complex, simply put everything in the main folder without any subfolders and update the index.html file accordingly. In the following images, you see a step by step example:

Setup a new repository
Setup a new repository

When naming your repo, have in mind that the name will be part of the URL (see below)

Upload your files
Upload your files
Wait for upload to complete
Wait for upload to complete
Make sure all files are here and edit index.html if neccessary
Make sure all files are here and edit index.html if neccessary
Check if the paths to the libraries are correct
Check if the paths to the libraries are correct
Edit if neccessary
Edit if neccessary
Go to settings > pages
Go to settings > pages
Select the branch of your repo, if you have not changed anything, this should be "main"
Select the branch of your repo, if you have not changed anything, this should be "main"
Save and you are ready to go
Save and you are ready to go

The URL where you can now find your website is: https://YOUR-USERNAME.github.io/NAME-OF-YOUR-REPO/

You can create as many of those repository websites as you want. Make sure that your website's HTML file is named index.html, if not you need to add it to your URL: https://YOUR-USERNAME.github.io/NAME-OF-YOUR-REPO/hello.html

Zurück zum Anfang