Skip to main content

About GitHub Pages

You can use GitHub Pages to host a website about yourself, your organization, or your project directly from a repository on GitHub AE.

GitHub Pages 适用于具有 GitHub AE 的内部和私有仓库。 GitHub Pages 适用于具有 GitHub Free 和组织的 GitHub Free 的公共仓库,以及具有 GitHub Pro、GitHub Team、GitHub Enterprise Cloud 和 GitHub Enterprise Server 的公共和私有仓库。

About GitHub Pages

GitHub Pages is a static site hosting service that takes HTML, CSS, and JavaScript files straight from a repository on GitHub AE, optionally runs the files through a build process, and publishes a website. You can see examples of GitHub Pages sites in the GitHub Pages examples collection.

To get started, see "Creating a GitHub Pages site."

Types of GitHub Pages sites

There are three types of GitHub Pages sites: project, user, and organization. Project sites are connected to a specific project hosted on GitHub AE, such as a JavaScript library or a recipe collection. User and organization sites are connected to a specific account on GitHub AE.

To publish a user site, you must create a repository owned by your personal account that's named <username>.<hostname>. To publish an organization site, you must create a repository owned by an organization that's named <organization>.<hostname>. User and organization sites are available at http(s)://pages.<hostname>/<username> or http(s)://pages.<hostname>/<organization>.

The source files for a project site are stored in the same repository as their project. Project sites are available at http(s)://pages.<hostname>/<username>/<repository>/ or http(s)://pages.<hostname>/<organization>/<repository>/.

You can only create one user or organization site for each account on GitHub AE. Project sites, whether owned by an organization or a personal account, are unlimited.

Publishing sources for GitHub Pages sites

警告:GitHub Pages 站点对所有企业成员可见,即使该站点的存储库是私有的也是如此。 如果站点的存储库中有敏感数据,你可能想要在发布前删除数据。 有关详细信息,请参阅关于存储库

将更改推送到特定分支时,会发布 GitHub Pages 站点。 可以指定要用作发布源的分支和文件夹。 源分支可以是存储库中的任何分支,源文件夹可以是源分支上的存储库根目录 (/),也可以是源分支上的 /docs 文件夹。 将更改推送到源分支时,源文件夹中的更改将发布到 GitHub Pages 站点。

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

Static site generators

GitHub Pages publishes any static files that you push to your repository. You can create your own static files or use a static site generator to build your site for you. You can also customize your own build process locally or on another server.

We recommend Jekyll, a static site generator with built-in support for GitHub Pages and a simplified build process. For more information, see "About GitHub Pages and Jekyll."

GitHub Pages will use Jekyll to build your site by default. If you want to use a static site generator other than Jekyll, disable the Jekyll build process by creating an empty file called .nojekyll in the root of your publishing source, then follow your static site generator's instructions to build your site locally.

GitHub Pages does not support server-side languages such as PHP, Ruby, or Python.

Limits on use of GitHub Pages

GitHub Pages is not intended for or allowed to be used as a free web-hosting service to run your online business, e-commerce site, or any other website that is primarily directed at either facilitating commercial transactions or providing commercial software as a service (SaaS). GitHub Pages 站点不应该用于敏感事务,例如发送密码或信用卡号码。

In addition, your use of GitHub Pages is subject to the GitHub Terms of Service, including the restrictions on get-rich-quick schemes, sexually obscene content, and violent or threatening content or activity.

Usage limits

GitHub Pages sites are subject to the following usage limits:

  • GitHub Pages source repositories have a recommended limit of 1 GB.
  • Published GitHub Pages sites may be no larger than 1 GB.

MIME types on GitHub Pages

A MIME type is a header that a server sends to a browser, providing information about the nature and format of the files the browser requested. GitHub Pages supports more than 750 MIME types across thousands of file extensions. The list of supported MIME types is generated from the mime-db project.

While you can't specify custom MIME types on a per-file or per-repository basis, you can add or modify MIME types for use on GitHub Pages. For more information, see the mime-db contributing guidelines.

Further reading