Add footer with handy info

This commit is contained in:
Danielle McLean 2017-10-23 10:35:29 +11:00
parent c74eb40d76
commit afcf101d09
Signed by: 00dani
GPG key ID: 5A5D2D1AFF12EEC5
2 changed files with 16 additions and 1 deletions

View file

@ -30,7 +30,11 @@
{% block main %}{% endblock %} {% block main %}{% endblock %}
</main> </main>
<footer></footer> <footer>
<p>all content licensed under <a rel="license" href="https://creativecommons.org/licenses/by-sa/4.0/">cc by-sa 4.0</a></p>
{% get_package_json as package %}
<p>powered by <a rel="code-repository" href="{{ package.repository }}/tree/v{{ package.version }}">{{ package.name }} {{ package.version }}</a></p>
</footer>
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" crossorigin="anonymous" <script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" crossorigin="anonymous"
integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN"></script> integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN"></script>

View file

@ -1,8 +1,19 @@
import json
from os.path import join
from django import template from django import template
from django.conf import settings from django.conf import settings
register = template.Library() 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 @register.simple_tag
def site_name(): def site_name():
return settings.LEMONCURRY_SITE_NAME return settings.LEMONCURRY_SITE_NAME