If you already have an account on GitHub, you skip to setting up GitHub Pages. Otherwise, you must sign up for a GitHub account. It’s free.
Go to github.com
Choose a username and submit your email. (You don’t need to sign up with your Cal Poly email, and you don’t need to use your Cal Poly’s username either.)
Choose a strong password that you have not used anywhere else.
Click on the big, green button that reads Sign up for GitHub
.
If you have used GitHub Pages with this account, you need to use the same repository with the name [yourusername].github.io
. In this case, skip to Publishing the first assignment on GitHub Pages
Next to Repositories
. click on the green button that reads New
to create a new repository.
Your new repository will be named: [yourusername].github.io
, where you replace [yourusername]
with your actual username. (Again, your GitHub username, not your Cal Poly’s username.)
Now that you have a repository, you get started by creating a new file.
All our assignments will be inside the folder grc338
in your repository. The way you create the new grc338
folder is by typing grc338
in the field that reads Name your file…. But you want to add a forward slash (/
) right after that, so GitHub understands it’s a folder.
Then, you do it again with the last part of the URL in the assignment instruction. For the first assignment, it’s helloworld
. Once again, you add a forward slash (/
) right after that, so GitHub understands it’s a folder.
Finally you name your actual file index.html
(without the forward slash, because it’s not a folder, it’s a file).
Then, you copy this text and paste into the file:
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="0" />
<title>GRC 338: Hello world assignment</title>
</head>
<body>
<h1>Hello world</h1>
</body>
</html>
Scroll down and click on the green button that reads Commit new file
. You gotta commit!
Navigate back to the folder you were working now and copy the URL to test on a new tab or window of your browser.
Don’t forget to submit it your URL to Canvas.
For the next assignments, you need to follow the instructions on part 2 of this tutorial.