From afcf101d095a5550bc46f92bf491acfa0f84ce0e Mon Sep 17 00:00:00 2001 From: Danielle McLean Date: Mon, 23 Oct 2017 10:35:29 +1100 Subject: [PATCH] Add footer with handy info --- lemoncurry/templates/lemoncurry/layout.html | 6 +++++- lemoncurry/templatetags/lemoncurry_tags.py | 11 +++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/lemoncurry/templates/lemoncurry/layout.html b/lemoncurry/templates/lemoncurry/layout.html index ad23434..23cd92e 100644 --- a/lemoncurry/templates/lemoncurry/layout.html +++ b/lemoncurry/templates/lemoncurry/layout.html @@ -30,7 +30,11 @@ {% block main %}{% endblock %} - + diff --git a/lemoncurry/templatetags/lemoncurry_tags.py b/lemoncurry/templatetags/lemoncurry_tags.py index 816a12e..ed8b6ff 100644 --- a/lemoncurry/templatetags/lemoncurry_tags.py +++ b/lemoncurry/templatetags/lemoncurry_tags.py @@ -1,8 +1,19 @@ +import json +from os.path import join + from django import template from django.conf import settings register = template.Library() + +@register.simple_tag +def get_package_json(): + with open(join(settings.BASE_DIR, 'package.json')) as f: + package = json.load(f) + return package + + @register.simple_tag def site_name(): return settings.LEMONCURRY_SITE_NAME