Extend support for apple devices

Add option to specify special icons for apple devices because icons on
apple devices are tailored to size differently
This commit is contained in:
Jonathan Weth
2020-01-04 12:47:28 +01:00
parent 9e44120320
commit 447aa7c06d
2 changed files with 17 additions and 4 deletions

View File

@@ -60,6 +60,12 @@ PWA_APP_ICONS = [
'sizes': '160x160' 'sizes': '160x160'
} }
] ]
PWA_APP_ICONS_APPLE = [
{
'src': '/static/images/my_apple_icon.png',
'sizes': '160x160'
}
]
PWA_APP_SPLASH_SCREEN = [ PWA_APP_SPLASH_SCREEN = [
{ {
'src': '/static/images/icons/splash-640x1136.png', 'src': '/static/images/icons/splash-640x1136.png',

View File

@@ -13,9 +13,16 @@
<meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-title" content="{{ PWA_APP_NAME }}"> <meta name="apple-mobile-web-app-title" content="{{ PWA_APP_NAME }}">
<meta name="apple-mobile-web-app-status-bar-style" content="default"> <meta name="apple-mobile-web-app-status-bar-style" content="default">
{% if PWA_APP_ICONS_APPLE %}
{% for icon in PWA_APP_ICONS_APPLE %}
<link rel="apple-touch-icon" href="{{ icon.src }}" sizes="{{ icon.size }}">
{% endfor %}
{% else %}
{% for icon in PWA_APP_ICONS %} {% for icon in PWA_APP_ICONS %}
<link rel="apple-touch-icon" href="{{ icon.src }}" sizes="{{ icon.size }}"> <link rel="apple-touch-icon" href="{{ icon.src }}" sizes="{{ icon.size }}">
{% endfor %} {% endfor %}
{% endif %}
{% for splash in PWA_APP_SPLASH_SCREEN %} {% for splash in PWA_APP_SPLASH_SCREEN %}