diff --git a/lemoncurry/jinja2.py b/lemoncurry/jinja2.py index 25546af..c459fe5 100644 --- a/lemoncurry/jinja2.py +++ b/lemoncurry/jinja2.py @@ -1,19 +1,23 @@ from django.contrib.staticfiles.storage import staticfiles_storage from django.urls import reverse from jinja2 import Environment -from compressor.contrib.jinja2ext import CompressorExtension +from compressor.contrib.jinja2ext import CompressorExtension +from django_activeurl.ext.django_jinja import ActiveUrl + +from entries.kinds import all as entry_kinds from .utils import load_package_json def environment(**options): env = Environment( - extensions=[CompressorExtension], + extensions=[ActiveUrl, CompressorExtension], trim_blocks=True, lstrip_blocks=True, **options ) env.globals.update({ + 'entry_kinds': entry_kinds, 'package': load_package_json(), 'static': staticfiles_storage.url, 'url': reverse, diff --git a/lemoncurry/jinja2/lemoncurry/layout.html b/lemoncurry/jinja2/lemoncurry/layout.html index c46f232..2d870e5 100644 --- a/lemoncurry/jinja2/lemoncurry/layout.html +++ b/lemoncurry/jinja2/lemoncurry/layout.html @@ -31,8 +31,43 @@ -
+ {% activeurl %} {% endactiveurl %} +