mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-03 23:00:14 -05:00
abda6e6338
closes #10773 - The refactoring is a substitute for `urlService.utils` used previously throughout the codebase and now extracted into the separate module in Ghost-SDK - Added url-utils stubbing utility for test suites - Some tests had to be refactored to avoid double mocks (when url's are being reset inside of rested 'describe' groups)
20 lines
675 B
JavaScript
20 lines
675 B
JavaScript
var urlUtils = require('../../lib/url-utils'),
|
|
settingsCache = require('../../services/settings/cache'),
|
|
imageLib = require('../../lib/image');
|
|
|
|
function getBlogLogo() {
|
|
var logo = {};
|
|
|
|
if (settingsCache.get('logo')) {
|
|
logo.url = urlUtils.urlFor('image', {image: settingsCache.get('logo')}, true);
|
|
} else {
|
|
// CASE: no publication logo is updated. We can try to use either an uploaded publication icon
|
|
// or use the default one to make
|
|
// Google happy with it. See https://github.com/TryGhost/Ghost/issues/7558
|
|
logo.url = imageLib.blogIcon.getIconUrl(true);
|
|
}
|
|
|
|
return logo;
|
|
}
|
|
|
|
module.exports = getBlogLogo;
|