Set a theme-color in the template again, so mobile Chrome uses it properly

This commit is contained in:
Danielle McLean 2018-06-28 11:10:56 +10:00
parent 5cf566251a
commit dec5ef153b
Signed by: 00dani
GPG key ID: 8EB789DDF3ABD240
3 changed files with 5 additions and 12 deletions

View file

@ -9,6 +9,7 @@ from django_activeurl.ext.django_jinja import ActiveUrl
from entries.kinds import all as entry_kinds from entries.kinds import all as entry_kinds
from .markdown import markdown from .markdown import markdown
from ..theme import color as theme_color
from ..utils import friendly_url, load_package_json from ..utils import friendly_url, load_package_json
@ -29,6 +30,7 @@ def environment(**options):
'package': load_package_json(), 'package': load_package_json(),
'settings': settings, 'settings': settings,
'static': staticfiles_storage.url, 'static': staticfiles_storage.url,
'theme_color': theme_color,
'url': reverse, 'url': reverse,
}) })
return env return env

View file

@ -5,13 +5,13 @@
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title class="p-name">{% if title %}{{ title }} ~ {% endif %}{{ request.site.name }}</title> <title class="p-name">{% if title %}{{ title }} ~ {% endif %}{{ request.site.name }}</title>
{% block head %}{% endblock %}
{% if atom is defined %} {% if atom is defined %}
<link rel="alternate" type="application/atom+xml" href="{{ atom }}" /> <link rel="alternate" type="application/atom+xml" href="{{ atom }}" />
{% endif %} {% endif %}
{% if rss is defined %} {% if rss is defined %}
<link rel="alternate" type="application/rss+xml" href="{{ rss }}" /> <link rel="alternate" type="application/rss+xml" href="{{ rss }}" />
{% endif %} {% endif %}
{% block head %}{% endblock %}
<link rel="authorization_endpoint" href="{{ url('lemonauth:indie') }}" /> <link rel="authorization_endpoint" href="{{ url('lemonauth:indie') }}" />
<link rel="manifest" href="{{ url('wellknowns:manifest') }}" /> <link rel="manifest" href="{{ url('wellknowns:manifest') }}" />
@ -20,6 +20,7 @@
<link rel="token_endpoint" href="{{ url('lemonauth:token') }}" /> <link rel="token_endpoint" href="{{ url('lemonauth:token') }}" />
<meta name="generator" content="{{ package.name }} {{ package.version }}" /> <meta name="generator" content="{{ package.name }} {{ package.version }}" />
<meta name="theme-color" content="{{ theme_color(10) }}" />
<link rel="stylesheet" type="text/css" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" <link rel="stylesheet" type="text/css" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css"
integrity="sha384-WskhaSGFgHYWDcbwN70/dfYBj47jz9qbsMId/iRN3ewGhXQFZCSftd1LZCfmhktB" crossorigin="anonymous"> integrity="sha384-WskhaSGFgHYWDcbwN70/dfYBj47jz9qbsMId/iRN3ewGhXQFZCSftd1LZCfmhktB" crossorigin="anonymous">

View file

@ -24,17 +24,7 @@ def manifest(request):
'start_url': urljoin(base, start_url), 'start_url': urljoin(base, start_url),
'background_color': color(0), 'background_color': color(0),
'theme_color': color(2), 'theme_color': color(10),
} }
# icons = FaviconImg.objects.filter(
# faviconFK__isFavicon=True,
# rel__in=rels,
# ).order_by('size')
# app['icons'] = [{
# 'type': 'image/png',
# 'sizes': '{0}x{0}'.format(icon.size),
# 'src': urljoin(base, icon.faviconImage.url),
# } for icon in icons]
return JsonResponse(app, content_type='application/manifest+json') return JsonResponse(app, content_type='application/manifest+json')