From e940dd1be42a58da0bf383be03fe80b8aeee927f Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Mon, 25 Jan 2016 14:09:22 -0800 Subject: [PATCH] Site: make github-pages project page url structure refer to site.github.url --- site/_docs/github-pages.md | 48 +++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 27 deletions(-) diff --git a/site/_docs/github-pages.md b/site/_docs/github-pages.md index 03d83b35..add661c3 100644 --- a/site/_docs/github-pages.md +++ b/site/_docs/github-pages.md @@ -15,6 +15,26 @@ Jonathan McGlone to get you up and running](http://jmcglone.com/guides/github-pa This guide will teach you what you need to know about Git, GitHub, and Jekyll to create your very own website on GitHub Pages. +### Project Page URL Structure + +Sometimes it's nice to preview your Jekyll site before you push your `gh-pages` +branch to GitHub. However, the subdirectory-like URL structure GitHub uses for +Project Pages complicates the proper resolution of URLs. In order to assure your +site builds properly, use `site.github.url` in your URL's. + +{% highlight html %} +{% raw %} + + + +{{ page.title }} +{% endraw %} +{% endhighlight %} + +This way you can preview your site locally from the site root on localhost, +but when GitHub generates your pages from the gh-pages branch all the URLs +will resolve properly. + ## Deploying Jekyll to GitHub Pages GitHub Pages work by looking at certain branches of repositories on GitHub. @@ -101,38 +121,12 @@ GitHub Pages
GitHub Pages Documentation, Help, and Support

For more information about what you can do with GitHub Pages, as well as for troubleshooting guides, you should check out GitHub’s Pages Help + href="https://help.github.com/categories/github-pages-basics/">GitHub’s Pages Help section. If all else fails, you should contact GitHub Support.