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

pull/1/head
Danielle McLean 4 years ago
parent 5cf566251a
commit dec5ef153b
Signed by: 00dani
GPG Key ID: 8EB789DDF3ABD240
  1. 2
      lemoncurry/jinja2/__init__.py
  2. 3
      lemoncurry/jinja2/lemoncurry/layout.html
  3. 12
      wellknowns/views/manifest.py

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

@ -5,13 +5,13 @@
<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>
{% block head %}{% endblock %}
{% if atom is defined %}
<link rel="alternate" type="application/atom+xml" href="{{ atom }}" />
{% endif %}
{% if rss is defined %}
<link rel="alternate" type="application/rss+xml" href="{{ rss }}" />
{% endif %}
{% block head %}{% endblock %}
<link rel="authorization_endpoint" href="{{ url('lemonauth:indie') }}" />
<link rel="manifest" href="{{ url('wellknowns:manifest') }}" />
@ -20,6 +20,7 @@
<link rel="token_endpoint" href="{{ url('lemonauth:token') }}" />
<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"
integrity="sha384-WskhaSGFgHYWDcbwN70/dfYBj47jz9qbsMId/iRN3ewGhXQFZCSftd1LZCfmhktB" crossorigin="anonymous">

@ -24,17 +24,7 @@ def manifest(request):
'start_url': urljoin(base, start_url),
'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')

Loading…
Cancel
Save