Free Web Hosting With GitHub Pages
Articles,  Blog

Free Web Hosting With GitHub Pages


This video is an extension to my tutorial
on using Jekyll, a static site generator. If you don’t know what Jekyll is, I recommend
you watching that video first by clicking the first link in the description. I’ll
show you how to host the files created with Jekyll on GitHub Pages for free. Other than
the fact that you can host your site for free, GitHub Pages offers benefits you might not
otherwise have, such as an effective use of a content delivery network, which means your
site will load faster around the world. I’ll start with the files that were created from
the previous video, located in the _sites folder. These are all of the files you’ll
need to put on the server. First, you’ll need to sign up for a GitHub account and download
the GitHub program. You can also use github from the terminal or command prompt. If you
want to learn more about using git and github, check out try.github.io for a simple walkthrough.
Once you have an account and the program, login to your account in the program under
the settings. Now, you can create a new repository called the name of your project. From here,
create a branch called G H hyphen pages. Open the folder’s location and copy and paste
the files Jekyll created into this folder. Now, in GitHub, type in a name and description
for your update and press commit. Click sync to push your changes to the server. All of
the files should be put on GitHub’s servers and can be viewed from a specific URL. You
can make a custom URL, but to see if it’s working, go to your GitHub username.github.io/
the project name. This can take some time to generate if it’s the first project for
an account. To point a custom URL to this server, you’ll first need to include a CNAME
file with the URL you want to use and nothing else. Save this file and commit it to the
root of the project repository in the gh-pages branch like before. Now, you need to tell
your domain registrar where to point to by creating an A record or an ALIAS record. I’ve
put a link to the GitHub help page explaining the difference between the two. For this example,
I’ll be using NameCheap domain registrar to create an A record. They offer cheap domains,
have good support, and accept bitcoin. Once you’ve created your account and bought your
domain, click on it and then click “All Host Records” on the left. From here, copy
the first IP address listed in the description and on screen in the first at (@) form and
make the record type an A Record with the TTL set to 1800. On the line with the three
w’s, type in your username.github.io. Make sure you include the last period. This record
type should be set to CNAME with the TTL set to 1800. Fill in a third form with an at (@) symbol
in the host name, the second IP address listed below in the the IP address field, with a
record type of A and then a TTL of 1800. As long as your CNAME file has your domain name
and is in the gh-pages branch of your GitHub project, you should see your site live within
about a half hour. I hope this series has been somewhat helpful to you. If you need
more information, check the links below this video or leave a comment and I’ll try to
reply when I can. Thanks for watching.

2 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *