diff --git a/controller/home.sh b/controller/home.sh index b2f603d..ab1d975 100644 --- a/controller/home.sh +++ b/controller/home.sh @@ -33,7 +33,9 @@ recipe() { ingredients="$(echo "$result" | getColumns 3)" nrIngredients="$(echo "$qts" | wc -l)" - title="" + tags="$(getTagsByRecipeId "$id" | getColumns 1)" + + title="$name" content="$(template "templates/recipe.fragment.templ")" template "templates/layout.html.templ" } diff --git a/data/recipes.sh b/data/recipes.sh index f7d1bcc..845b344 100644 --- a/data/recipes.sh +++ b/data/recipes.sh @@ -35,6 +35,18 @@ getRecipeById() { EOF } +getTagsByRecipeId() { + local id="$(echo "$1" | sed 's/[^0-9]//g')" + + query <{{ print "$name" }} +

from {{ print "$author" }}