summaryrefslogtreecommitdiffstats
path: root/retro/templatetags/retro.py
diff options
context:
space:
mode:
Diffstat (limited to 'retro/templatetags/retro.py')
-rw-r--r--retro/templatetags/retro.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/retro/templatetags/retro.py b/retro/templatetags/retro.py
new file mode 100644
index 0000000..c7fd9f0
--- /dev/null
+++ b/retro/templatetags/retro.py
@@ -0,0 +1,13 @@
+from django import template
+from django.contrib.staticfiles.storage import staticfiles_storage
+
+register = template.Library()
+
+
+@register.simple_tag
+def retro_static(year, path):
+ """Like the built-in {% static %} tag but with a little extra magic."""
+ full_path = "%s/%s" % (year, path)
+ return staticfiles_storage.url(full_path)
+
+# vim: set ts=4 sw=4 et: