From 32b3847d5209dbbb9ecdd8150f267b889f1bd50d Mon Sep 17 00:00:00 2001 From: Rafael dos Santos Silva Date: Wed, 1 Nov 2017 01:51:51 -0200 Subject: [PATCH] FIX: Update mobile logo resolution This makes Discourse compliant with latest Google PWA requirements, so we get the App Install banner back. Should bump our Lighthouse PWA Audit score to 11/11. --- app/controllers/metadata_controller.rb | 6 ++++-- config/locales/server.en.yml | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/controllers/metadata_controller.rb b/app/controllers/metadata_controller.rb index 5785c331762..8c5886e917e 100644 --- a/app/controllers/metadata_controller.rb +++ b/app/controllers/metadata_controller.rb @@ -13,6 +13,8 @@ class MetadataController < ApplicationController private def default_manifest + logo = SiteSetting.mobile_logo_url || SiteSetting.logo_small_url || SiteSetting.apple_touch_icon_url + manifest = { name: SiteSetting.title, short_name: SiteSetting.title, @@ -23,8 +25,8 @@ class MetadataController < ApplicationController theme_color: "##{ColorScheme.hex_for_name('header_background')}", icons: [ { - src: SiteSetting.apple_touch_icon_url, - sizes: "144x144", + src: logo, + sizes: "512x512", type: "image/png" } ] diff --git a/config/locales/server.en.yml b/config/locales/server.en.yml index cbc605d584d..75cb0bb7ee4 100644 --- a/config/locales/server.en.yml +++ b/config/locales/server.en.yml @@ -1011,7 +1011,7 @@ en: digest_logo_url: "The alternate logo image used at the top of your site's email summary. Should be a wide rectangle shape. Should not be an SVG image. If left blank `logo_url` will be used." logo_small_url: "The small logo image at the top left of your site, should be a square shape, seen when scrolling down. If left blank a home glyph will be shown." favicon_url: "A favicon for your site, see http://en.wikipedia.org/wiki/Favicon, to work correctly over a CDN it must be a png" - mobile_logo_url: "The fixed position logo image used at the top left of your mobile site. Should be a square shape. If left blank, `logo_url` will be used. eg: http://example.com/uploads/default/logo.png" + mobile_logo_url: "The fixed position logo image used at the top left of your mobile site and as your logo/splash image on Android. Recommended size is 512px by 512px. If left blank, `logo_url` will be used. eg: http://example.com/uploads/default/logo.png" apple_touch_icon_url: "Icon used for Apple touch devices. Recommended size is 144px by 144px." notification_email: "The from: email address used when sending all essential system emails. The domain specified here must have SPF, DKIM and reverse PTR records set correctly for email to arrive."