1
0
mirror of synced 2025-12-22 03:16:52 -05:00
Files
docs/content/github/working-with-github-pages/testing-your-github-pages-site-locally-with-jekyll.md
Vanessa Yuen 3df90fc9b8 Hello git history spelunker!
Are you looking for something? Here is all of the GitHub Docs history in one single commit. Enjoy! 🎉
2020-09-27 14:10:11 +02:00

2.7 KiB

title, intro, redirect_from, product, versions
title intro redirect_from product versions
Testing your GitHub Pages site locally with Jekyll You can build your {{ site.data.variables.product.prodname_pages }} site locally to preview and test changes to your site.
/articles/setting-up-your-pages-site-locally-with-jekyll/
/articles/setting-up-your-github-pages-site-locally-with-jekyll/
/articles/testing-your-github-pages-site-locally-with-jekyll
{{ site.data.reusables.gated-features.pages }}
free-pro-team enterprise-server
* *

Anyone with read permissions for a repository can test a {{ site.data.variables.product.prodname_pages }} site locally.

Prerequisites

Before you can use Jekyll to test a site, you must:

{{ site.data.reusables.pages.recommend-bundler }}

{{ site.data.reusables.pages.jekyll-install-troubleshooting }}

Building your site locally

{{ site.data.reusables.command_line.open_the_multi_os_terminal }} {{ site.data.reusables.pages.navigate-publishing-source }} 3. Run your Jekyll site locally.

$ bundle exec jekyll serve
> Configuration file: /Users/octocat/my-site/_config.yml
>            Source: /Users/octocat/my-site
>       Destination: /Users/octocat/my-site/_site
> Incremental build: disabled. Enable with --incremental
>      Generating...
>                    done in 0.309 seconds.
> Auto-regeneration: enabled for '/Users/octocat/my-site'
> Configuration file: /Users/octocat/my-site/_config.yml
>    Server address: http://127.0.0.1:4000/
>  Server running... press ctrl-c to stop.
  1. To preview your site, in your web browser, navigate to http://localhost:4000.

Updating the {{ site.data.variables.product.prodname_pages }} gem

Jekyll is an active open source project that is updated frequently. If the github-pages gem on your computer is out of date with the github-pages gem on the {{ site.data.variables.product.prodname_pages }} server, your site may look different when built locally than when published on {{ site.data.variables.product.product_name }}. To avoid this, regularly update the github-pages gem on your computer.

{{ site.data.reusables.command_line.open_the_multi_os_terminal }} 2. Update the github-pages gem. - If you installed Bundler, run bundle update github-pages. - If you don't have Bundler installed, run gem update github-pages.

Further reading