Skip to content

Commit

Permalink
Update bundled logos with new branding (#8702)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
julianlam and barisusakli committed Oct 18, 2020
1 parent c107649 commit ff4fcc2
Show file tree
Hide file tree
Showing 15 changed files with 56 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# <img alt="NodeBB" src="https://github.com/NodeBB/assets/raw/master/nodebb-svg/nodebb.svg" />
# ![NodeBB](public/images/logo.svg)

[![Build Status](https://travis-ci.org/NodeBB/NodeBB.svg?branch=master)](https://travis-ci.org/NodeBB/NodeBB)
[![Coverage Status](https://coveralls.io/repos/github/NodeBB/NodeBB/badge.svg?branch=master)](https://coveralls.io/github/NodeBB/NodeBB?branch=master)
Expand Down
Binary file modified public/favicon.ico
Binary file not shown.
Binary file modified public/images/logo.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions public/images/logo.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/logo@3x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/touch/144.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/touch/192.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/touch/36.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/touch/48.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/touch/512.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/touch/72.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/touch/96.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/logo.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
43 changes: 38 additions & 5 deletions src/meta/tags.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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({
Expand Down Expand Up @@ -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',
});
}
}
2 changes: 1 addition & 1 deletion src/middleware/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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, {
Expand Down

0 comments on commit ff4fcc2

Please sign in to comment.