当已经有自定义 CNAME 时,在多个存储库上使用 Github 页面?

Use Github pages on multiple repositories when one has a custom CNAME already?

我设置了一个 Github 存储库来托管一个小型静态站点。托管它的存储库采用以下格式:

username.github.io

此存储库设置为使用 custom domain 并有一个 CNAME 文件来正确执行此操作。此存储库完全按预期工作。

现在我想设置一个 project page 并将 gh-pages 分支用于不同的存储库。但是,当我这样做时,第一个存储库中的 CNAME 似乎适用,我被重定向到 example.com/REPOSITORYNAME 而不是使用与此单独存储库关联的预期 username.github.io/projectname


如何在不重定向 gh-pages 存储库到第一个存储库中定义的自定义域?

截至 2016 年 8 月,我认为这是不可能的。 (https://help.github.com/articles/custom-domain-redirects-for-github-pages-sites/)

Github 页面帮助文章指出

Project Pages site owned by a user account, such as username.github.io/projectname, will be Automatically redirected to a subdirectory of a User Pages site custom domain (user.example.com/projectname), unless a different CNMAE is specified, such as project.example.com

最简单的方法是为您决定以这种方式管理的每个网站创建一个 Github 组织。

在这种情况下,我必须发布到 master 而不是 gh-pages

更多信息在这里:https://help.github.com/articles/user-organization-and-project-pages/