Skip to content

Commit

Permalink
Update assets host URL (#90)
Browse files Browse the repository at this point in the history
Merge pull request 90
  • Loading branch information
jekyllbot authored Feb 13, 2019
1 parent dd00962 commit 76e3052
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ I give this plugin two :+1:!

## Emoji images

For GitHub Pages sites built on GitHub.com, emoji images are served from the GitHub.com CDN, with a base URL of `https://assets-cdn.github.com`, which results in emoji image URLs like `https://assets-cdn.github.com/images/icons/emoji/unicode/1f604.png`.
For GitHub Pages sites built on GitHub.com, emoji images are served from the GitHub.com CDN, with a base URL of `https://github.githubassets.com`, which results in emoji image URLs like `https://github.githubassets.com/images/icons/emoji/unicode/1f604.png`.

On GitHub Enterprise installs, page builds receive the `ASSET_HOST_URL` environment variable, which contain a value like `https://assets.ghe.my-company.com`. This results in emoji images for GitHub Pages sites built on a GitHub Enterprise install being served at URLs like `https://assets.ghe.my-company.com/images/icons/emoji/unicode/1f604.png`.

Expand Down
4 changes: 2 additions & 2 deletions lib/jemoji.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

module Jekyll
class Emoji
GITHUB_DOT_COM_ASSET_HOST_URL = "https://assets-cdn.github.com"
GITHUB_DOT_COM_ASSET_HOST_URL = "https://github.githubassets.com"
ASSET_PATH = "/images/icons/"
BODY_START_TAG = "<body"
OPENING_BODY_TAG_REGEX = %r!<body(.*?)>\s*!.freeze
Expand All @@ -25,7 +25,7 @@ def emojify(doc)

# Public: Create or fetch the filter for the given {{src}} asset root.
#
# src - the asset root URL (e.g. https://assets-cdn.github.com/images/icons/)
# src - the asset root URL (e.g. https://github.githubassets.com/images/icons/)
#
# Returns an HTML::Pipeline instance for the given asset root.
def filter_with_emoji(src)
Expand Down
2 changes: 1 addition & 1 deletion spec/fixtures/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<link rel="stylesheet" href="/css/screen.css">
</head>
<body class="wrap">
<p><img class="emoji" title=":+1:" alt=":+1:" src="https://assets-cdn.github.com/images/icons/emoji/unicode/1f44d.png" height="20" width="20"></p>
<p><img class="emoji" title=":+1:" alt=":+1:" src="https://github.githubassets.com/images/icons/emoji/unicode/1f44d.png" height="20" width="20"></p>

</body>

Expand Down
2 changes: 1 addition & 1 deletion spec/fixtures/index_without_body_attributes.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<link rel="stylesheet" href="/css/screen.css">
</head>
<body>
<p><img class="emoji" title=":+1:" alt=":+1:" src="https://assets-cdn.github.com/images/icons/emoji/unicode/1f44d.png" height="20" width="20"></p>
<p><img class="emoji" title=":+1:" alt=":+1:" src="https://github.githubassets.com/images/icons/emoji/unicode/1f44d.png" height="20" width="20"></p>

</body>

Expand Down
2 changes: 1 addition & 1 deletion spec/fixtures/minified_index.html
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<!DOCTYPE HTML><html lang="en-US"><head><meta charset="UTF-8"><title>Jemoji Minified</title><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="stylesheet" href="/css/screen.css"></head><body class="wrap"><p><img class="emoji" title=":+1:" alt=":+1:" src="https://assets-cdn.github.com/images/icons/emoji/unicode/1f44d.png" height="20" width="20"></p>
<!DOCTYPE HTML><html lang="en-US"><head><meta charset="UTF-8"><title>Jemoji Minified</title><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="stylesheet" href="/css/screen.css"></head><body class="wrap"><p><img class="emoji" title=":+1:" alt=":+1:" src="https://github.githubassets.com/images/icons/emoji/unicode/1f44d.png" height="20" width="20"></p>
</body></html>
2 changes: 1 addition & 1 deletion spec/fixtures/minified_index_without_body_attributes.html
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<!DOCTYPE HTML><html lang="en-US"><head><meta charset="UTF-8"><title>Plain Jemoji Minified</title><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="stylesheet" href="/css/screen.css"></head><body><p><img class="emoji" title=":+1:" alt=":+1:" src="https://assets-cdn.github.com/images/icons/emoji/unicode/1f44d.png" height="20" width="20"></p>
<!DOCTYPE HTML><html lang="en-US"><head><meta charset="UTF-8"><title>Plain Jemoji Minified</title><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="stylesheet" href="/css/screen.css"></head><body><p><img class="emoji" title=":+1:" alt=":+1:" src="https://github.githubassets.com/images/icons/emoji/unicode/1f44d.png" height="20" width="20"></p>
</body></html>
2 changes: 1 addition & 1 deletion spec/jemoji_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
end
let(:emoji) { described_class }
let(:site) { Jekyll::Site.new(configs) }
let(:default_src) { "https://assets-cdn.github.com/images/icons/" }
let(:default_src) { "https://github.githubassets.com/images/icons/" }
let(:result) do
<<-STR.strip
<img class="emoji" title=":+1:" alt=":+1:" src="#{default_src}emoji/unicode/1f44d.png" height="20" width="20">
Expand Down

0 comments on commit 76e3052

Please sign in to comment.