Homepage
Your Homepage is your very own personal web space for the semester. This is where you will host all of the projects, websites, and any other related work for this class. We’ll turn projects in by publishing them to our Homepages.
We’ll be using something called Git to publish our Homepages through a Git repository hosting site called GitHub. Git is a version control system that is widely used within the developer community. Git records changes made to our files and allows us to revert to older versions if necessary. You can read more here.
First, we have to set up our GitHub account and make our first repository. Repository is just a more project-centric name for “folder”. We’ll be storing all of our website files within this repository.
- Make an account on GitHub (make sure to verify the account)
- Make a new repository by clicking the “+” in the top-right and selecting “new repository”
- Name your repository whatever you would like (or something like “homepage” if you can’t think of anything)
- Check “Initialize this repository with a README”
- Create the repository
Now, in order for our repository to be rendered as a website, we’ll want to initialize GitHub Pages on this repository. Github pages is a feature offered by Github (there are similar services offered by other git platforms) that makes it easy and free to host handmade websites.
- On the repository page, navigate to the settings tab and select “Pages” from the sidebar
- Change the branch from “none” to “main”
- Leave the second dropdown as “/(root)”
- Click save
Next, we need to create a link between our local files and the online repository:
- Download GitHub Desktop
- Open the GitHub Desktop application and login with your GitHub credentials
- Go to File > clone repository
- Select the newly created repository
- Change the local path to a location that is unlikely to change (and one you will remember easily)
- Click “clone”
Now we have a local folder that is linked to our Github repository. Now, we just need to make our index.html and publish the changes!
- Find the folder that you just created
- Open your text editor, create a new file in your repository folder, and name it index.html
- Add all the necessary ingredients to the html document
- Make sure to add something in the body, so you can confirm everything is working
- Save
- Open the GitHub Desktop application
- Select the new repository in the left-hand panel
- It should show that there is 1 changed file
- In the bottom-left dialog box, name the change (called a “commit”) something like: “create index.html” (it can be anything you like, but the clearer the better)
- Click “Commit to main”
*Commiting makes a record of our changes locally - And, finally, click the “Push origin” button in the top-right
*Pushing uploads our commits to our online repository - Wait a minute or two for the changes to be applied to the online respository
- The changes that we made locally are now hosted online in our github repository!
- Any time we want to publish new changes to our website, we will need to make sure to commit those changes and then push them using the GitHub Desktop application before they will be reflected online
Your website will be published to your-github-username.github.io/respository-name. The changes will likely not appear immediatedly, so you will need to wait a minute or two.
If it's been a few minutes and the changes are still not appearing, you can try a hard reset of the page by pressing ctrl+shift+r (on PC) or cmd+shift+r (on mac). This will refresh the page and clear the browser cache for the site which sometimes stores old information and versions of the page so it loads faster when revisted.
Spend some time setting up your Homepage. You can design it however you like. Think ahead and consider the content that we will be adding to our Homepages over the course of the class in order to determine the ways that it can grow or adapt to the content being added. But don’t fret too much at this point, the Homepage will hopefully change quite a bit over the course of the class as you learn more. This will be your personal portal to every project that we do in this class. Make it personal! The only requirement is that it’s navigable and that all the links work!