Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for building the base URL from ENV on Enterprise #40

Merged
merged 2 commits into from
Aug 29, 2016

Conversation

jdennes
Copy link
Contributor

@jdennes jdennes commented Aug 26, 2016

This is an alternative to #35 and jekyll/github-metadata#65, and fixes #34.

In a GitHub Enterprise environment, the SSL and GITHUB_HOSTNAME environment variables are available to the page build process, meaning they can be used to correctly build the base URL for mentions when this plugin is used, instead of https://github.com being incorrectly used by default.

Similar to jekyll/jemoji#45.

@benbalter, @parkr: Could you take a look?

This allows the default mention base URL to be set correctly based
on the SSL and GITHUB_HOSTNAME environment variables that are set
in a GitHub Enterprise environment, so that https://github.com is
not incorrectly used by default.

it "uses correct mention URLs when SSL and GITHUB_HOSTNAME are set" do
# Re-render the site, so that ENV is used
site.render
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is done because ENV values are set in this context's before(:each) block, but the site is rendered in the parent before(:each) block, meaning the original render doesn't get the ENV values.

@parkr
Copy link
Member

parkr commented Aug 26, 2016

Thank you! This LGTM.

@benbalter
Copy link
Contributor

LGTM.

@benbalter
Copy link
Contributor

@jekyllbot: merge +minor

@jekyllbot jekyllbot merged commit 2a3c140 into jekyll:master Aug 29, 2016
jekyllbot added a commit that referenced this pull request Aug 29, 2016
@jdennes jdennes deleted the default-mention-base branch August 29, 2016 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Hostname defaults to GitHub.com even in GitHub Enterprise
4 participants