From befb81caa8099472da2099c9f3f958b6a0c4c70d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20Ke=C3=9Fler?= Date: Tue, 5 Dec 2023 17:39:33 +0100 Subject: [PATCH] deduplicate website templates --- src/render_site.py | 2 -- templates/content.html | 33 +++++++++++++++++++++- templates/layout.html | 48 +++++++++----------------------- templates/variant.html | 62 ++++-------------------------------------- 4 files changed, 50 insertions(+), 95 deletions(-) diff --git a/src/render_site.py b/src/render_site.py index e71e370..ca62d5d 100644 --- a/src/render_site.py +++ b/src/render_site.py @@ -386,6 +386,4 @@ def render_leaderboard(): # Copy CSS to output directory shutil.copytree('css', 'build/css', dirs_exist_ok=True) -for x in get_games(): - print(x) render_leaderboard() diff --git a/templates/content.html b/templates/content.html index 98e3971..717acfb 100644 --- a/templates/content.html +++ b/templates/content.html @@ -1,4 +1,35 @@ {% extends "layout.html" %} + +{% block navbar %} + +{% endblock %} + {% block content %}
@@ -111,4 +142,4 @@
-{% endblock %} +{% endblock %} diff --git a/templates/layout.html b/templates/layout.html index 120708c..253fbfd 100644 --- a/templates/layout.html +++ b/templates/layout.html @@ -5,37 +5,20 @@ Hanabi Pro Hunting League - + + + - + + + + + + + + {% block navbar %}{% endblock %} {% block content %}{% endblock %} - - - - - - + - + - - +{% extends "layout.html" %} +{% block navbar %} +{% endblock %} +{% block content %}
- {% for num_players, stats in variant_stats.items() %}
@@ -90,45 +79,4 @@ }); {% endfor %} - -
-
- {{ total_games_played }} games | {{ total_players }} players | Thanks for playing <3
- Last updated: {{ latest_run }} -
-
- - - - - - - - - - - - - - +{% endblock %}