title: Jekyll with GitHub Enterprise
body: <p>I'm following this guide to get me started with Jekyll: <a href="https://help.github.com/articles/setting-up-your-github-pages-site-locally-with-jekyll/" rel="noreferrer">Setting up your GitHub Pages site locally with Jekyll</a>, but I'm doing this against GitHub Enterprise. My repo is at <code>https://github.company.com/myorg/myrepo</code>, and GitHub Pages are served from <code>https://pages.github.company.com/myorg/myrepo</code> (or <code>https://github.company.com/pages/myorg/myrepo</code>).</p>
  
  <p>The step <code>bundle exec jekyll new . --force</code> in the tutorial created a simple template site, and I modified <code>_config.yml</code> to include this:</p>
  
  <pre><code>baseurl: ""
  url: "https://pages.github.company.com/myorg/myrepo"
  repository: "myorg/myrepo"
  </code></pre>
  
  <p>But after I ran <code>bundle exec jekyll serve</code>, I see it going out to public GitHub:</p>
  
  <pre><code>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&amp;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
  </code></pre>
  
  <p>Looking at this: <a href="https://help.github.com/enterprise/2.7/user/articles/repository-metadata-on-github-pages/" rel="noreferrer">Repository metadata on GitHub Pages</a>, I figured I could override some GitHub metadata settings in <code>_config.yml</code> to point to GitHub Enterprise, so I added this:</p>
  
  <pre><code>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
  </code></pre>
  
  <p>But it doesn't change anything, it still goes out to public GitHub API.</p>
  
  <p>Looking at this: <a href="https://github.com/jekyll/github-metadata" rel="noreferrer">github-metadata</a>, I tried overriding the API:</p>
  
  <pre><code>$ PAGES_API_URL="https://api.github.company.com" bundle exec jekyll serve
  </code></pre>
  
  <p>But it didn't work either.</p>
  
  <p>The site does actually 'build', but if I go to <code>https://127.0.0.1:4000/</code> the site title link in there takes me to <code>http://github.com/pages/myorg/myrepo/</code>. How do I get it to actually use GitHub Enterprise?</p>