From bb9f19ff04eea4517a608c094febd0664a020b5a Mon Sep 17 00:00:00 2001 From: "Dustin C. Hatch" Date: Sun, 2 Jul 2017 11:25:09 -0500 Subject: [PATCH] templates: Move template boilerplate to base Moving HTML boilerplate to a separate file will allow other templates to inherit it. --- src/dcow/templates/base.html.j2 | 23 +++++++++++++++++++++++ src/dcow/templates/gallery.html.j2 | 23 +++++------------------ 2 files changed, 28 insertions(+), 18 deletions(-) create mode 100644 src/dcow/templates/base.html.j2 diff --git a/src/dcow/templates/base.html.j2 b/src/dcow/templates/base.html.j2 new file mode 100644 index 0000000..ec23e43 --- /dev/null +++ b/src/dcow/templates/base.html.j2 @@ -0,0 +1,23 @@ + + + + +{%- block head %} + + Dark Chest of Wonders + +{% endblock head -%} + + + +
+
+

Dark Chest of Wonders

+
+
+{% block body %} +{% endblock body -%} + + + diff --git a/src/dcow/templates/gallery.html.j2 b/src/dcow/templates/gallery.html.j2 index 7530fce..b18cef7 100644 --- a/src/dcow/templates/gallery.html.j2 +++ b/src/dcow/templates/gallery.html.j2 @@ -1,18 +1,7 @@ - - - - - - Dark Chest of Wonders - - - - -
-
-

Dark Chest of Wonders

-
+{% extends "base.html.j2" %} +{% block body %} +
{% for image in images|reverse %} @@ -24,6 +13,4 @@
{% endfor %}
- - - +{% endblock body %}