-
Notifications
You must be signed in to change notification settings - Fork 56
Setup a website using GitHub Pages
This is how you can setup your repo to be displayed as a website using GitHub pages.
Use your forked course repo on GitHub.
Ensure you have synced your "source" upstream, before you proceed.
You can publish each repo of GitHub as a website to GitHub Pages. This is an easy way to test HTML, CSS and client side JavaScript.
It is a setting where you choose to publish your repo onto GitHub Pages.
You can use the help as a reference.
Go you your repo on GitHub and select the tab labeled "Settings".
Scroll down to the section on GitHub Pages.
Select the source to be "Master branch". Your whole repo will then be accessible as web pages.
The setting is changed and you will see the url to the website. You need to wait a minute or two, for the website to update itself.
The website is cached and it will always take a minute or two to update itself, even when you later on publish small changes to it.
Lets try to add a web page in the directory work/s01
. Use your texteditor to add it and write some text in it.
Add it to the repo, commit and push your changes. Wait a minut or two.
Open a web browser to your GitHub pages site and add work/s01/hello.html
to it and load your newly created page. It should be visible in your web browser.
Create an index.html
in the directory work/s01
and create two links (<a>
) in it. The links should be to your hello.html
and try.html
.
Publish it and check that the web browser opens the index page when you access work/s01
.
When you currently open a web browser to the root of you website at GitHub Pages, you will see the content of the README.md
. Lets make a index.html
to replace that as your home page for the repo.
Your index.html
should link to work/s01
so one can reach those pages just by clicking on the links in the web page.
Publish it and check that all links works.
Feel free o add information, images and details to your home page.
.
..: Copyright (c) 2020 Mikael Roos, [email protected]