👋🏼 Don't use ghosticon.jpg from admin assets (#8285)

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.
This commit is contained in:
Aileen Nowak 2017-04-07 20:07:47 +07:00 committed by Hannah Wolfe
parent 83f084608f
commit f0f3c2f2a7
3 changed files with 10 additions and 4 deletions

View File

@ -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

View File

@ -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'
};

View File

@ -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();
};
@ -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();
};