Hallo, Entdecker! An dieser Seite wird aktiv gearbeitet, oder sie wird noch übersetzt. Die neuesten und genauesten Informationen finden Sie in unserer englischsprachigen Dokumentation.
Artikelversion: Enterprise Server 2.15

Diese Version von GitHub Enterprise wird eingestellt am Diese Version von GitHub Enterprise wurde eingestellt am 2019-10-16. Es wird keine Patch-Freigabe vorgenommen, auch nicht für kritische Sicherheitsprobleme. For better performance, improved security, and new features, upgrade to the latest version of GitHub Enterprise. For help with the upgrade, contact GitHub Enterprise support.

GitHub Pages-Website lokal mit Jekyll testen

You can build your GitHub Pages site locally to preview and test changes to your site.

GitHub Pages is available in public repositories with GitHub Free, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server.

Anyone with read permissions for a repository can test a GitHub Pages site locally.

Inhalt dieses Artikels

Voraussetzungen

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

We recommend using Bundler to install and run Jekyll. Bundler manages Ruby gem dependencies, reduces Jekyll build errors, and prevents environment-related bugs. To install Bundler:

  1. Install Ruby. For more information, see "Installing Ruby" in the Ruby documentation.
  2. Install Bundler. For more information, see "Bundler."

Tip: If you see a Ruby error when you try to install Jekyll using Bundler, you may need to use a package manager, such as RVM or Homebrew, to manage your Ruby installation. For more information, see "Troubleshooting" in the Jekyll documentation.

Building your site locally

  1. Open TerminalTerminalGit Bashthe terminal.

  2. Navigate to the publishing source for your site. For more information about publishing sources, see "About GitHub Pages."

  3. Führen Sie Ihre Jekyll-Website lokal aus.

    $ 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.
  4. To preview your site, in your web browser, navigate to http://localhost:4000.

Updating the GitHub 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 GitHub Pages server, your site may look different when built locally than when published on GitHub Enterprise. To avoid this, regularly update the github-pages gem on your computer.

  1. Open TerminalTerminalGit Bashthe 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.

Weiterführende Informationen

Menschliche Unterstützung einholen

Sie können das Gesuchte nicht finden?

Kontakt