Adds external URL to the recipe

This commit is contained in:
Miguel de la Cruz 2024-08-03 08:48:56 +02:00
parent 7a5ab7cf09
commit 432be8dfb2
3 changed files with 13 additions and 1 deletions

View file

@ -12,6 +12,10 @@
<div id="content">
<h1>{{.name}}</h1>
{{if ne .url ""}}
<a class="recipe-url" href="{{.url}}">External URL</a>
{{end}}
{{$recipeImage := recipeImage .path}}
{{if ne $recipeImage ""}}
<img class="recipeimage" src="{{$recipeImage}}" />
@ -21,8 +25,9 @@
<ul>
{{$m := .recipe.Metadata}}
{{$nameKey := .nameKey}}
{{$urlKey := .urlKey}}
{{range $k := sortedMetadataKeys $m}}
{{if ne $k $nameKey}}
{{if and (ne $k $nameKey) (ne $k $urlKey)}}
<li><em>{{$k}}:</em> {{index $m $k}}</li>
{{end}}
{{end}}