Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Preview
Start a free Courses trial
to watch this video
GitHub provides a simple hosting solution called GitHub Pages that lets others view your repository like any other website.
Resources
Video review
- GitHub Pages does not work with sites that use a server-side language, because it can't execute languages like Ruby, Python, or PHP.
- GitHub Pages only works with static websites containing HTML, CSS and JavaScript files.
- There are two types of websites you can store on GitHub Pages: User Pages and Project Pages.
- User Pages are stored in a special repository dedicated to your GitHub Pages files.
- As a GitHub user, you’re entitled to one free user website per account.
- With Project Pages, each repository in your GitHub account can have its own website.
- Project Pages sites are served under a subpath that matches a repository's name.
- User Pages sites do not display a subpath in the URL.
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
[SOUND] Hey, everyone.
0:00
I'm Guil,
a front-end teacher here at Treehouse.
0:04
In this workshop I'm gonna show you how
to host your website on GitHub Pages
0:07
for free.
0:12
Did you know you can do that?
0:13
By now you know that Git is version
control system commonly used for
0:14
collaborating on open source projects and
0:18
GitHub is a website that lets you host,
get repositories on line so
0:21
that others can see your projects,
use them and work on them with you.
0:25
For example, with GitHub,
0:29
you can share your code with other
people in the web community, or
0:30
if you work in an organization, you can
have an organizational GitHub account.
0:33
Where all the developers put their code,
pull down the current code for
0:37
the project and work on it together.
0:40
Now a repository is just
a collection of files,
0:43
like the files used in your website
that you keep track of with Git.
0:46
Normally when you put a website project or
any project up on GitHub,
0:50
you're just storing the website's
files in a repository.
0:54
But GitHub also provides a simple
hosting solution, called GitHub Pages,
0:58
that lets others view your repository
just like any other website.
1:03
In fact, you can host multiple websites,
and it's all completely free.
1:06
So So that you don't have to go
through hosting providers or
1:11
the tedious process of
setting up hosting package.
1:13
This is why many popular websites
are hosted on GitHub pages.
1:17
For example, the websites for
1:21
Twitter, Bootstrap and Zurb Foundation
are stored and served from GitHub pages.
1:22
Now, there are some limitations
on the types of sites
1:28
you can host with GitHub pages.
1:31
GitHub pages does not work with sites that
uses a server-side language because it
1:33
can't execute languages like Ruby,
Python or PHP.
1:37
GitHub pages works with
static websites only.
1:40
These are sites Containing HTML,
CSS and JavaScript files.
1:44
There are two types of websites you can
store on GitHub pages, user pages and
1:48
project pages.
1:53
Both types are similar and
can host the same types of websites,
1:54
you just create and store them
differently within GitHub pages.
1:58
I'll cover how to create
the two types soon but first,
2:01
let's go over a few important differences
between user pages and project pages.
2:04
User pages are stored in a special
repository dedicated to your
2:10
GitHub pages files.
2:13
As a GitHub user, you're entitled to
one free user website per account.
2:15
User pages are commonly used for
hosting a portfolio website or
2:20
an organization's main website.
2:23
With Project Pages,
2:26
each repository in your GitHub
account can have its own website.
2:27
If you have repositories for several
open source projects, you can host and
2:30
publish a website for each project.
2:33
That's how foundation and
bootstrap post our websites.
2:36
Also, the URL structure GitHub uses for
2:39
product pages is slightly different from
the URL structure used for user pages.
2:42
Project pages sites are served under a
sub-path that matches a repository's name.
2:48
The URL for a project page's website
will look like this, the username,
2:53
followed by the GitHub pages domain,
and the repository name.
2:57
[MUSIC]
3:01
User pages sites do not
display a sub-path in the URL.
3:02
They display the username,
followed by the GitHub pages domain.
3:06
But, as you'll soon learn,
you can use your own custom domain that
3:10
points to a website stored as
either user pages or project pages.
3:13
Now that you know a little
bit about GitHub pages,
3:17
it's time to get your site published.
3:20
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up