From 389a88088e8f5e40127d024a95c8f63318669b02 Mon Sep 17 00:00:00 2001 From: Botond Hende Date: Fri, 1 May 2026 23:00:43 +0200 Subject: codenames and comic templates refactored with the base template --- codenames/templates/codenames.html.j2 | 28 +++++++++------------------- comic/templates/issue.html.j2 | 25 ++++++++----------------- global/templates/base.html.j2 | 8 +++----- modules/codenames_generate.py | 1 + 4 files changed, 21 insertions(+), 41 deletions(-) diff --git a/codenames/templates/codenames.html.j2 b/codenames/templates/codenames.html.j2 index 0e1e17a..ca54abd 100644 --- a/codenames/templates/codenames.html.j2 +++ b/codenames/templates/codenames.html.j2 @@ -1,17 +1,9 @@ - - - - - {{ title }} - - - - - - - - -
+{% extends "base.html.j2" %} +{% block page_title %}{{ codenames.codenames_name }}{% endblock %} +{% block og_page_title %}{{ codenames.codenames_name }}{% endblock %} +{% block head_extra %}{{ super() }} + {% endblock %} +{% block body %}
@@ -71,9 +63,7 @@
-
- -
+
{% endblock %} +{% block footer %} - - +{% endblock %} \ No newline at end of file diff --git a/comic/templates/issue.html.j2 b/comic/templates/issue.html.j2 index 181604f..81afc04 100644 --- a/comic/templates/issue.html.j2 +++ b/comic/templates/issue.html.j2 @@ -1,18 +1,11 @@ - - - - - {{ issue.title() }} - {{ comic.comic_name }} - - - - - +{% extends "base.html.j2" %} +{% block page_title %}{{ issue.title() }} - {{ comic.comic_name }}{% endblock %} +{% block og_page_title %}{{ issue.title() }}{% endblock %} +{% block og_type %}article{% endblock %} +{% block head_extra %}{{ super() }} - - - -
+ {% endblock %} +{% block body %} -
- - +{% endblock %} diff --git a/global/templates/base.html.j2 b/global/templates/base.html.j2 index 61826d9..21530c7 100644 --- a/global/templates/base.html.j2 +++ b/global/templates/base.html.j2 @@ -5,14 +5,12 @@ {% block page_title %}{% endblock %} - + - {% block head_extra %}{% endblock %} +{% block head_extra %} {% endblock %} {% block body %}{% endblock %} -
- {% block footer %}{% endblock %} -
+ diff --git a/modules/codenames_generate.py b/modules/codenames_generate.py index 19fd284..d5aba60 100644 --- a/modules/codenames_generate.py +++ b/modules/codenames_generate.py @@ -18,6 +18,7 @@ def generate(jinja_env: jinja2.Environment, output_root_path: str, local: bool): os.mkdir(output_root_path) jinja_env.globals.update(codenames={ + "codenames_name": Config.CODENAMES_NAME, "codenames_url": Config.CODENAMES_ROOT_URL, }) -- cgit v1.3