Skip to main content

What is GitHub Pages?

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

谁可以使用此功能?

GitHub Pages 适用于具有 GitHub Free 和组织的 GitHub Free 的公共存储库,以及具有 GitHub Pro、GitHub Team、GitHub Enterprise Cloud 和 GitHub Enterprise Server 的公共和专用存储库。 有关详细信息,请参阅 GitHub 的计划

GitHub Pages 现在使用 GitHub Actions 来执行 Jekyll 构建。 使用分支作为构建源时,如果要使用内置的 Jekyll 工作流,则必须在存储库中启用 GitHub Actions。 或者,如果 GitHub Actions 不可用或已禁用,则将 .nojekyll 文件添加到源分支的根目录将绕过 Jekyll 构建过程并直接部署内容。 有关启用 GitHub Actions 的详细信息,请参阅“管理存储库的 GitHub Actions 设置”。

About GitHub Pages

GitHub Pages is a static site hosting service that takes HTML, CSS, and JavaScript files straight from a repository on GitHub, 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.

Types of GitHub Pages sites

There are two types of GitHub Pages sites. Sites associated with a user or organization account, and sites for a specific project.

Property User and organization sites Project sites
Source files Must be stored in a repository named <owner>.github.io, where <owner> is the personal or organization account name Stored in a folder within the repository that contains the project's code
Limits Maximum of one pages site per account Maximum of one pages site per repository
Default site location http(s)://<owner>.github.io http(s)://<owner>.github.io/<repositoryname>

If you publish your site privately, the URL for your site will be different. For more information, see 更改 GitHub Pages 站点的可见性.

Hosting on your own custom domain

You can host your site on GitHub's github.io domain or your own custom domain. See 配置 GitHub Pages 站点的自定义域.

Further reading