From 1cd29c397d55183481323f37859d934d4558e6e7 Mon Sep 17 00:00:00 2001 From: Max Value Date: Tue, 13 May 2025 01:23:24 +0100 Subject: [PATCH] Added descriptions to main recipe list --- sous.py | 12 ++++++++++-- templates/index.html | 4 ++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/sous.py b/sous.py index 6994bce..9b91fe3 100755 --- a/sous.py +++ b/sous.py @@ -32,9 +32,17 @@ class RecipeBook: for word in recipe.recipe["information"]["keywords"]: if word in keywords: - keywords[word].append((recipe.recipe["information"]["title"], recipe.recipe["html"])) + keywords[word].append(( + recipe.recipe["html"], + recipe.recipe["information"]["title"], + recipe.recipe["information"]["description"] + )) else: - keywords |= { word: [(recipe.recipe["information"]["title"], recipe.recipe["html"])]} + keywords |= { word: [( + recipe.recipe["html"], + recipe.recipe["information"]["title"], + recipe.recipe["information"]["description"] + )]} template = self.html_environment.get_template("index.html") with open("index.html", "w") as f: diff --git a/templates/index.html b/templates/index.html index 1515464..4535d10 100644 --- a/templates/index.html +++ b/templates/index.html @@ -18,7 +18,7 @@

All recipes

Keywords

@@ -26,7 +26,7 @@

{{ word }}

{% endfor %} -- 2.39.2