我们经常发布文档更新,此页面的翻译可能仍在进行中。有关最新信息,请访问英文文档。如果此页面上的翻译有问题,请告诉我们

Adding a theme to your GitHub Pages site with the theme chooser

You can add a theme to your GitHub 页面 site to customize your site’s look and feel.

GitHub 页面 可用于具有 GitHub Free 的公共仓库,以及具有 GitHub Pro、GitHub Team、GitHub Enterprise Cloud 和 GitHub Enterprise Server 的公共和私有仓库。更多信息请参阅“GitHub 的产品。”

People with admin permissions for a repository can use the theme chooser to add a theme to a GitHub 页面 site.

本文内容

About the theme chooser

The theme chooser adds a Jekyll theme to your repository. For more information about Jekyll, see "About GitHub 页面 and Jekyll."

How the theme chooser works depends on whether your repository is public or private.

For more information about publishing sources, see "About GitHub 页面."

If you manually added a Jekyll theme to your repository in the past, those files may be applied even after you use the theme chooser. To avoid conflicts, remove all manually added theme folders and files before using the theme chooser. For more information, see "Adding a theme to your GitHub 页面 site using Jekyll."

Adding a theme with the theme chooser

  1. On GitHub, navigate to your site's repository.

  2. 在仓库名称下,单击 Settings(设置)

    仓库设置按钮

  3. Under "GitHub 页面," click Choose a theme or Change theme.

    Choose a theme button

  4. On the top of the page, click the theme you want, then click Select theme.

    Theme options and Select theme button

  5. You may be prompted to edit your site's README.md file.

Your chosen theme will automatically apply to markdown files in your repository. To apply your theme to HTML files in your repository, you need to add YAML front matter that specifies a layout to each file. For more information, see "Front Matter" on the Jekyll site.

延伸阅读

问问别人

找不到要找的内容?

联系我们