GitHub Pages {

We use a tool called GitHub Pages on GitHub to be able to host our coursework on their servers, making it visible to anyone on the web if we wish. It’s an amazing cheap web hosting option! Here’s how to set it up.

In this module

Activating GitHub Pages

  1. Go to https://www.github.com/yourgithubusername/cart253 (the homepage of your new course repository, substitute your GitHub username for yourgithubusername and if you called the repository something other than cart253 use that instead)
  2. Click on “Settings” (the right-most option in the repository’s menu)
  3. Go to the menu item “Pages” in the left-hand menu bar
  4. Under Source use the drop-down menu to select “Deploy from a branch”
  5. Under Branch use the drop-down menu to select “main”
  6. Click “Save”

Note: It can take a little time for this change to take effect, so do be patient if it doesn’t work at first in the next step.

Note: Any time you start a new repository that you want to use GitHub Pages you need to activate it for that repository.

View a project online

The point of GitHub Pages is to make your programming projects available online as a website. Let’s view the version-control-workflow project you created earlier. Once GitHub Pages is active, it should be at:

https://yourgithubusername.github.io/cart253/topics/version-control/version-control-workflow/

All going to plan, when you build the right URL you’ll see the project in the browser, but this time it’s onlin! You could send it to your friends and relatives! Why not??

The GitHub Pages URL

When you want a link to your projects online (and you will need this) it’s always the same structure:

https://yourgithubusername.github.io/yourrepositoryname/path/to/the/projectfolder/

Summary

Remember to activate GitHub Pages for any repository you want to be able to view like a website. And practice understanding how to write the URL that points you at a project inside that repository.

}