2016-10-22 108 views
2

我遵循本指南讓我開始使用Jekyll:Setting up your GitHub Pages site locally with Jekyll,但我正在對GitHub企業做這個。我的回購是在https://github.company.com/myorg/myrepo,並從https://pages.github.company.com/myorg/myrepo(或https://github.company.com/pages/myorg/myrepo)提供GitHub頁面。Jekyll與GitHub企業

教程步驟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 

看着這個:Repository metadata on GitHub Pages,我想我可以覆蓋_config.yml中的一些GitHub元數據設置指向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?

+0

您必須將您的回購商名稱重命名爲:my_company.github.io並且就是這樣 –

+0

這就是說,如果我想創建一個完整的用戶/組織頁面嗎?我只是想創建一個項目頁面,「myorg/myrepo」。 –

回答

0

我認爲這是你正在尋找的:https://help.github.com/enterprise/2.9/user/articles/user-organization-and-project-pages/#project-pages 當然,確保你的GitHub Enterprise版本是正確選擇的。

http(s)://[hostname]/pages/<orgname>/<projectname>/http(s)://pages.[hostname]/<orgname>/<projectname>/如果啓用了子域名。

您可能還需要在你的倉庫設置頁面正確「使能」 GitHub的網頁:https://help.github.com/enterprise/2.9/user/articles/configuring-a-publishing-source-for-github-pages/