Skip to content

Commit

Permalink
👋🏼 Don't use ghosticon.jpg from admin assets (#8285)
Browse files Browse the repository at this point in the history
refs #8221

Use our default `favicon.ico` instead of `ghosticon.jpg` which is served from the admins' assets.
Adds additionally fake image dimensions for our json-ld data to satisfy Google.
  • Loading branch information
aileen authored and ErisDS committed Apr 7, 2017
1 parent 83f0846 commit f0f3c2f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
8 changes: 7 additions & 1 deletion core/server/data/meta/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,13 @@ function getMetaData(data, root) {
if (settingsCache.get('logo')) {
metaData.blog.logo.url = utils.url.urlFor('image', {image: settingsCache.get('logo')}, true);
} else {
metaData.blog.logo.url = utils.url.urlJoin(utils.url.urlFor('admin'), 'img/ghosticon.jpg');
metaData.blog.logo.url = utils.url.urlFor({relativeUrl: 'favicon.ico'}, true);
// Setting image dimensions to force the default logo to be an `ImageObject` and make
// Google happy with it. See https://github.com/TryGhost/Ghost/issues/7558
metaData.blog.logo.dimensions = {
width: 60,
height: 60
};
}

// TODO: cleanup these if statements
Expand Down
2 changes: 1 addition & 1 deletion core/server/data/slack/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ function ping(post) {
slackData = {
text: message,
unfurl_links: true,
icon_url: utils.url.urlJoin(utils.url.urlFor('admin', true), 'img/ghosticon.jpg'),
icon_url: utils.url.urlFor({relativeUrl: 'favicon.ico'}, true),
username: 'Ghost'
};

Expand Down
4 changes: 2 additions & 2 deletions core/test/unit/slack_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ describe('Slack', function () {
settingsAPIStub.calledOnce.should.be.true();
requestOptions.should.have.property('href').and.be.equal('https://hooks.slack.com/services/a-b-c-d');
requestData.should.have.property('text').and.be.equal('http://myblog.com/');
requestData.should.have.property('icon_url').and.be.equal('http://myblog.com/ghost/img/ghosticon.jpg');
requestData.should.have.property('icon_url').and.be.equal('http://myblog.com/favicon.ico');
requestData.should.have.property('username').and.be.equal('Ghost');
done();
};
Expand All @@ -222,7 +222,7 @@ describe('Slack', function () {
settingsAPIStub.calledOnce.should.be.true();
requestOptions.should.have.property('href').and.be.equal('https://hooks.slack.com/services/a-b-c-d');
requestData.should.have.property('text').and.be.equal('Hi!');
requestData.should.have.property('icon_url').and.be.equal('https://myblog.com/ghost/img/ghosticon.jpg');
requestData.should.have.property('icon_url').and.be.equal('https://myblog.com/favicon.ico');
requestData.should.have.property('username').and.be.equal('Ghost');
done();
};
Expand Down

0 comments on commit f0f3c2f

Please sign in to comment.