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 setting a default asset host URL in an ASSET_HOST_URL environment variable #45

Merged
merged 5 commits into from
Jul 17, 2016

Conversation

jdennes
Copy link
Contributor

@jdennes jdennes commented Jul 14, 2016

This adds support for loading the default asset URL from an ASSET_HOST_URL environment variable. In a GitHub Enterprise environment, this supports fixing an issue where assets were being loaded from the GitHub.com rather asset host rather than using the GitHub Enterprise appliance's asset hostname.

For review by @benbalter, @parkr, @jldec.

In a GitHub Enterprise environment, this allows the default asset
host to be read from an ASSET_HOST_URL environment variable so
that the GitHub.com CDN is not used by default.
@@ -4,7 +4,8 @@

module Jekyll
class Emoji
GITHUB_DOT_COM_ASSET_ROOT = "https://assets.github.com/images/icons/".freeze
GITHUB_DOT_COM_ASSET_HOST_URL = "https://assets.github.com".freeze
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be assets or assets-cdn?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll update this to https://assets-cdn.github.com as part of this pull request too.

This points to the GitHub.com asset CDN rather than directly at
GitHub hosts.
@parkr
Copy link
Member

parkr commented Jul 15, 2016

LGTM. Thanks for the PR, @jdennes!

Would you mind adding some docs to the README about how to configure the asset host, including the requirement that the emoji be at the correct subpath?

Specifically, describe how assets URLs are generated for different
environments: GitHub.com uses the GitHub.com assets CDN, and
GitHub Enterprise uses the base URL included in the
ASSET_HOST_URL environment variable, which is set for the page
build environment on the GitHub Enterprise install.
@jdennes
Copy link
Contributor Author

jdennes commented Jul 16, 2016

Would you mind adding some docs to the README about how to configure the asset host, including the requirement that the emoji be at the correct subpath?

In 3756b57, I added an "Emoji images" section to the README (rendered), which describes how asset URLs are generated in different environments.

I didn't include anything about ASSET_HOST_URL in the "Customizing" section, because I think it's still preferable for people to use their _config.yml to customise this themselves, which is why I left that section how it is.

Anyway, let me know what you think.

@parkr
Copy link
Member

parkr commented Jul 16, 2016

Thanks, @jdennes! LGTM.

@parkr
Copy link
Member

parkr commented Jul 17, 2016

@jekyllbot: merge

@jekyllbot jekyllbot merged commit 5e4f924 into jekyll:master Jul 17, 2016
jekyllbot added a commit that referenced this pull request Jul 17, 2016
@jekyll jekyll locked and limited conversation to collaborators Apr 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants