Jekyll: github_username always generates a link to username at github.com, not enterprise domain

Created on 20 May 2016  ·  4Comments  ·  Source: jekyll/jekyll

  • [X] I believe this to be a bug, not a question about using Jekyll.
  • [X] I Updated to the latest Jekyll (or) if on Github Pages to the latest github-pages
  • [X] I Read the CONTRIBUTION file at https://jekyllrb.com/docs/contributing/
  • [X] I looked on talk.jekyllrb.com for mention of enterprise
  • [X] I searched for other users with similar problems
  • [X] As a new user of jekyll I'm still worried about looking stupid but I can't find out how to solve this
  • [ ] This is a feature request.

  • [X] I am on (or have tested on) _Mac OS_ 10+
  • [ ] I am on (or have tested on) _Debian/Ubuntu_ GNU/Linux
  • [ ] I am on (or have tested on) _Fedora_ GNU/Linux
  • [ ] I am on (or have tested on) _Arch_ GNU/Linux
  • [ ] I am on (or have tested on) _Other_ GNU/Linux
  • [ ] I am on (or have tested on) _Windows_ 10+

  • [ ] I was trying to install.
  • [ ] There is a broken Plugin API.
  • [ ] I had an error on Github Pages, and I have not tested locally.
  • [ ] I had an error on Github Pages, and Github Support said it was a Jekyll Bug.
  • [ ] I had an error on Github Pages and I did not test it locally.
  • [ ] I was trying to build.
  • [X] It was another bug.

    My Reproduction Steps

Generate a new jekyll site and push it to gh-pages branch; edit _config.yml to add a github_username to link to the users account. The link generated will be to github.com, not the place your github enterprise repository is hosted. In my case a 404 is the result since my enterprise github username is not the same as my github username.

I think the file that causes this is found in the gem at jekyll-3.1.6/lib/site_template/_includes/icon-github.html - I'm an absolute ruby novice so I don't want to try changing this to see if it makes a difference, have had a broken ruby installation once and don't want to risk it.

The Output I Wanted

links generated should be https://github.myenterprisedomain.com not https://github.com

frozen-due-to-age

Most helpful comment

@aeberbach, just a note: when @parkr says

for now please edit your copy of _includes/icon-github.html in your site

It's a reference to the _includes/icon-github.html in the site folder wherever you are developing your jekyll project. (the same folder where your _config.yml file is)

It is not a reference to the installed gem files you mentioned of jekyll-3.1.6/lib/site_template/_includes/icon-github.html - don't change the actual gem files.

Sorry if this is already something you know, but you mentioned editing a gem file in your post, and that's not a good idea.

All 4 comments

@aeberbach Hey, it sounds like you're having trouble with the site template. The template isn't supposed to encompass Enterprise at the moment (specifying just a github_username wouldn't suffice here; we'd also need the github URL, in this case https://github.myenterprisedomain.com).

When you run jekyll new, we generate these files and you are free to modify them. You are correct that icon-github.html is where you need to go to edit this. Simply change github.com to github.myenterprisedomain.com.

We're in the process of moving the example site out to its own theme for Jekyll 3.2 and we can re-evaluate then how this should be considered. We will want to support this going forward for sure, but for now please edit your copy of _includes/icon-github.html in your site.

/cc @jglovier on an elegant way to support Enterprise user links in the site template. 😄

@aeberbach, just a note: when @parkr says

for now please edit your copy of _includes/icon-github.html in your site

It's a reference to the _includes/icon-github.html in the site folder wherever you are developing your jekyll project. (the same folder where your _config.yml file is)

It is not a reference to the installed gem files you mentioned of jekyll-3.1.6/lib/site_template/_includes/icon-github.html - don't change the actual gem files.

Sorry if this is already something you know, but you mentioned editing a gem file in your post, and that's not a good idea.

Got it - that will work for now, thank you both.

/cc @jglovier on an elegant way to support Enterprise user links in the site template.

Sorry for the delayed response. I'll open an issue in the minima gem theme where we can track this. :sparkles:

Was this page helpful?
0 / 5 - 0 ratings

Related issues

muromtsev picture muromtsev  ·  3Comments

JohnStarich picture JohnStarich  ·  4Comments

nasht00 picture nasht00  ·  3Comments

SurajVerma picture SurajVerma  ·  4Comments

MertcanGokgoz picture MertcanGokgoz  ·  3Comments