Skip to content

Commit

Permalink
FIX: Update mobile logo resolution
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
xfalcox committed Nov 1, 2017
1 parent d888d3c commit 32b3847
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions app/controllers/metadata_controller.rb
Expand Up @@ -13,6 +13,8 @@ def opensearch
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,
Expand All @@ -23,8 +25,8 @@ def default_manifest
theme_color: "##{ColorScheme.hex_for_name('header_background')}",
icons: [
{
src: SiteSetting.apple_touch_icon_url,
sizes: "144x144",
src: logo,
sizes: "512x512",
type: "image/png"
}
]
Expand Down
2 changes: 1 addition & 1 deletion config/locales/server.en.yml
Expand Up @@ -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."
Expand Down

2 comments on commit 32b3847

@discoursebot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit has been mentioned on Discourse Meta. There might be relevant details there:

https://meta.discourse.org/t/add-to-homescreen-banner-on-android/42973/67

@discoursebot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit has been mentioned on Discourse Meta. There might be relevant details there:

https://meta.discourse.org/t/add-to-homescreen-banner-on-android/42973/71

Please sign in to comment.