我正在按照本指南开始使用 Jekyll:使用 Jekyll在本地设置您的 GitHub Pages 站点,但我是针对 GitHub Enterprise 执行此操作的。我的仓库位于https://github.company.com/myorg/myrepo
,GitHub Pages 来自https://pages.github.company.com/myorg/myrepo
(或https://github.company.com/pages/myorg/myrepo
)。
教程中的步骤bundle exec jekyll new . --force
创建了一个简单的模板站点,我进行了修改_config.yml
以包含以下内容:
baseurl: ""
url: "https://pages.github.company.com/myorg/myrepo"
repository: "myorg/myrepo"
但是在我运行之后bundle exec jekyll serve
,我看到它会发布到公共 GitHub:
Generating...
GitHub Metadata: No GitHub API authentication could be found. Some fields may be missing or have incorrect data.
GitHub Metadata: GET https://api.github.com/repos/myorg/myrepo: 404 - Not Found // See: https://developer.github.com/v3
GitHub Metadata: GET https://api.github.com/repos/myorg/myrepo/pages: 404 - Not Found // See: https://developer.github.com/v3
GitHub Metadata: GET https://api.github.com/repos/myorg/myrepo/contributors?per_page=100: 404 - Not Found // See: https://developer.github.com/v3
GitHub Metadata: GET https://api.github.com/orgs/myorg: 404 - Not Found // See: https://developer.github.com/v3
GitHub Metadata: GET https://api.github.com/users/myorg/repos?per_page=100&type=public: 404 - Not Found // See: https://developer.github.com/v3
GitHub Metadata: GET https://api.github.com/repos/myorg/myrepo/releases?per_page=100: 404 - Not Found // See: https://developer.github.com/v3
看着这个:GitHub Pages 上的存储库元数据,我想我可以覆盖一些 GitHub 元数据设置_config.yml
以指向 GitHub Enterprise,所以我添加了这个:
github:
hostname: github.company.com
pages_hostname: pages.github.company.com
api_url: https://api.github.company.com
repository_url: https://github.company.com/myrepo/myorg
但它并没有改变任何东西,它仍然提供给公共 GitHub API。
看着这个:github-metadata,我尝试覆盖 API:
$ PAGES_API_URL="https://api.github.company.com" bundle exec jekyll serve
但它也没有奏效。
该网站实际上是“构建”的,但如果我去那里https://127.0.0.1:4000/
的网站标题链接,我会转到http://github.com/pages/myorg/myrepo/
. 如何让它真正使用 GitHub Enterprise?