Update bundled logos with new branding (#8702)

* feat: updating logo assets, square logos missing still

* fix: squared logo for touch icon and notification fallback

* fix: update link to favicon

* feat: add default touch icon sizes, if one isn't uploaded

Co-authored-by: Barış Soner Uşaklı <barisusakli@gmail.com>
This commit is contained in:
Julian Lam
2020-10-18 01:41:04 -04:00
committed by GitHub
parent c107649b40
commit ff4fcc23b6
15 changed files with 56 additions and 7 deletions

View File

@@ -55,7 +55,7 @@ Tags.parse = async (req, data, meta, link) => {
var defaultLinks = [{
rel: 'icon',
type: 'image/x-icon',
href: nconf.get('relative_path') + nconf.get('upload_url') + '/system/favicon.ico' + (Meta.config['cache-buster'] ? '?' + Meta.config['cache-buster'] : ''),
href: nconf.get('relative_path') + '/favicon.ico' + (Meta.config['cache-buster'] ? '?' + Meta.config['cache-buster'] : ''),
}, {
rel: 'manifest',
href: nconf.get('relative_path') + '/manifest.webmanifest',
@@ -100,6 +100,39 @@ Tags.parse = async (req, data, meta, link) => {
sizes: '192x192',
href: nconf.get('relative_path') + nconf.get('upload_url') + '/system/touchicon-192.png',
});
} else {
defaultLinks.push({
rel: 'apple-touch-icon',
href: nconf.get('relative_path') + '/assets/images/touch/512.png',
}, {
rel: 'icon',
sizes: '36x36',
href: nconf.get('relative_path') + '/assets/images/touch/192.png',
}, {
rel: 'icon',
sizes: '48x48',
href: nconf.get('relative_path') + '/assets/images/touch/144.png',
}, {
rel: 'icon',
sizes: '72x72',
href: nconf.get('relative_path') + '/assets/images/touch/96.png',
}, {
rel: 'icon',
sizes: '96x96',
href: nconf.get('relative_path') + '/assets/images/touch/72.png',
}, {
rel: 'icon',
sizes: '144x144',
href: nconf.get('relative_path') + '/assets/images/touch/48.png',
}, {
rel: 'icon',
sizes: '192x192',
href: nconf.get('relative_path') + '/assets/images/touch/36.png',
}, {
rel: 'icon',
sizes: '512x512',
href: nconf.get('relative_path') + '/assets/images/touch/512.png',
});
}
const results = await utils.promiseParallel({
@@ -192,18 +225,18 @@ function addSiteOGImage(meta) {
// Push fallback logo
meta.push({
property: 'og:image',
content: nconf.get('url') + '/assets/logo.png',
content: nconf.get('url') + '/assets/images/logo@3x.png',
noEscape: true,
}, {
property: 'og:image:url',
content: nconf.get('url') + '/assets/logo.png',
content: nconf.get('url') + '/assets/images/logo@3x.png',
noEscape: true,
}, {
property: 'og:image:width',
content: '128',
content: '963',
}, {
property: 'og:image:height',
content: '128',
content: '225',
});
}
}

View File

@@ -121,7 +121,7 @@ middleware.routeTouchIcon = function routeTouchIcon(req, res) {
if (meta.config['brand:touchIcon']) {
iconPath = path.join(nconf.get('upload_path'), meta.config['brand:touchIcon'].replace(/assets\/uploads/, ''));
} else {
iconPath = path.join(nconf.get('base_dir'), 'public/logo.png');
iconPath = path.join(nconf.get('base_dir'), 'public/images/touch/512.png');
}
return res.sendFile(iconPath, {