•  


Testing your GitHub Pages site locally with Jekyll - GitHub Docs
Skip to main content

Testing your GitHub Pages site locally with Jekyll

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

Who can use this feature?

GitHub Pages is available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see " GitHub’s plans ."

All GitHub Pages builds will use GitHub Actions from June 30, 2024. No other changes are required but GitHub Actions must be enabled in your repository for builds to continue. For more information on enabling GitHub Actions, see " Managing GitHub Actions settings for a repository ."

Platform navigation

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

Prerequisites

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 Terminal Terminal Git Bash .

  2. Navigate to the publishing source for your site. For more information, see " Configuring a publishing source for your GitHub Pages site ."

  3. Run bundle install .

  4. 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.
    
    

    Note: If you've installed Ruby 3.0 or later (which you may have if you installed the default version via Homebrew), you might get an error at this step. That's because these versions of Ruby no longer come with webrick installed.

    To fix the error, try running bundle add webrick , then re-running bundle exec jekyll serve .

  5. 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. To avoid this, regularly update the github-pages gem on your computer.

  1. Open Terminal Terminal Git Bash .
  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

- "漢字路" 한글한자자동변환 서비스는 교육부 고전문헌국역지원사업의 지원으로 구축되었습니다.
- "漢字路" 한글한자자동변환 서비스는 전통문화연구회 "울산대학교한국어처리연구실 옥철영(IT융합전공)교수팀"에서 개발한 한글한자자동변환기를 바탕하여 지속적으로 공동 연구 개발하고 있는 서비스입니다.
- 현재 고유명사(인명, 지명등)을 비롯한 여러 변환오류가 있으며 이를 해결하고자 많은 연구 개발을 진행하고자 하고 있습니다. 이를 인지하시고 다른 곳에서 인용시 한자 변환 결과를 한번 더 검토하시고 사용해 주시기 바랍니다.
- 변환오류 및 건의,문의사항은 juntong@juntong.or.kr로 메일로 보내주시면 감사하겠습니다. .
Copyright ⓒ 2020 By '전통문화연구회(傳統文化硏究會)' All Rights reserved.
 한국   대만   중국   일본