Update manifest.json with extra properties, set theme colour properly as a <meta> as well

This commit is contained in:
Danielle McLean 2017-10-28 15:05:54 +11:00
parent b172d9f139
commit 7429d43280
Signed by untrusted user: 00dani
GPG key ID: 5A5D2D1AFF12EEC5
4 changed files with 33 additions and 8 deletions

View file

@ -1,4 +1,4 @@
{% load compress favtags lemoncurry_tags meta static %}<!doctype html>
{% load compress favtags lemoncurry_tags meta static theme_colour %}<!doctype html>
<html lang="en" class="{% block html_class %}{% endblock %}">
<head{% meta_namespaces %}>{% site_name as site_name %}{% request_uri request as uri %}{% request_origin request as origin %}
<base href="{{ origin }}" />
@ -9,7 +9,9 @@
<link rel="hub" href="{% get_push_hub %}" />
<link rel="self" href="{{ uri }}" />
<link rel="manifest" href="{% url 'wellknowns:manifest' %}" />
<meta name="theme-color" content="{% theme_colour 2 %}" />
<meta property="og:url" content="{{ uri }}" />
<meta property="og:title" content="{% firstof title site_name %}" />

View file

@ -0,0 +1,9 @@
from django import template
from ..theme import color
register = template.Library()
@register.simple_tag
def theme_colour(i):
return color(i)

View file

@ -9,3 +9,7 @@ path = join(
)
with open(path, 'r') as f:
theme = safe_load(f)
def color(i):
return '#' + theme['base0' + format(i, '1X')]