From 3bf38ad0d3e6ef7b5259a2b7a7f59611646e26a2 Mon Sep 17 00:00:00 2001 From: "Benjamin J. Balter" Date: Mon, 15 Apr 2013 16:25:40 -0400 Subject: [PATCH] significant rewrite of baseurl section for clarity, props mattr- --- site/_posts/2012-07-01-upgrading.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/site/_posts/2012-07-01-upgrading.md b/site/_posts/2012-07-01-upgrading.md index e9700b35..33c03a0c 100644 --- a/site/_posts/2012-07-01-upgrading.md +++ b/site/_posts/2012-07-01-upgrading.md @@ -82,8 +82,10 @@ and add a new markdown file to it. To preview your new post, simply run the Often, you'll want the ability to run a Jekyll site in multiple places, such as previewing locally before pushing to GitHub Pages. Jekyll 1.0 makes that -easier with the new `--baseurl` flag. Throughout your Jekyll site, simply -prefix relative urls with `{{ site.baseurl }}` and add the production `baseurl` -to your `_config.yml` file. When previewing locally, Jekyll will swap in -whatever you pass along via the `--baseurl` flag (most likely `/`), ensuring -your links remain true in both environments. \ No newline at end of file +easier with the new `--baseurl` flag. To take advantage of this feature, first +add the production `baseurl` to your site's `_config.yml` file. Then, +throughout the site, simply prefix relative URLs with `{{ site.baseurl }}`. +When you're ready to preview your site locally, pass along the `--baseurl` flag +with your local baseurl (most likely `/`) to `jekyll serve` and Jekyll will +swap in whatever you've passed along, ensuring all your links work as you'd +expect in both environments.