This repository has been archived by the owner on Jun 21, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 47
Creating a GitHub Pages demo
Christine Wang edited this page Apr 30, 2016
·
1 revision
Deploying your changes to GitHub Pages gives you a publicly accessible place to demonstrate your changes before they actually go to the website.
Ok, but why it so much more complicated for ME to create a GitHub Pages demo?
Unfortunately, GitHub pages doesn't support plugins, and we have a plugin to obfuscate email addresses. Attempting to push to origin/gh-pages
directly from the master
branch on your machine will give you a build error. So we need to generate all the static files first and push only those to your gh-pages
branch.
Before you try to create a demo in GitHub Pages, make sure you have the following:
- A working dev environment (should be the case after completing the Getting started guide)
- Create a new branch off
master
calledgenerate-site
in yourwebsite/
repository:git checkout -b generate-site
- Create a Rakefile by copying this file. Make sure to change the
ORIGIN_REPO
variable to your GitHub repo's URL. Add the Rakefile to yourwebsite/
directory, at the same level as the README. - Add this robots.txt to the
website/
directory at the same level as the README. This prevents your test site from being indexed by Google. - Commit these changes to the
generate-site
branch. - Run
rake build_gh_pages
from the command line within thewebsite/
directory. This updates the website files in yourgenerate-site
branch, builds the static files, and copies the static files into a different directory calledcompile_site/
. It also pushes the changes to your GitHub repo'sgh-pages
branch.