sandwitchboard/templates/recipe.html.tmpl
2024-08-03 08:48:56 +02:00

51 lines
1.5 KiB
Cheetah

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>{{.name}}</title>
<link rel="icon" type="image/png" href="{{.relpath}}favicon.png" />
<link rel="stylesheet" type="text/css" href="{{.relpath}}style.css" />
</head>
<body>
<main>
<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}}" />
{{end}}
{{if ne (len .recipe.Metadata) 0}}
<ul>
{{$m := .recipe.Metadata}}
{{$nameKey := .nameKey}}
{{$urlKey := .urlKey}}
{{range $k := sortedMetadataKeys $m}}
{{if and (ne $k $nameKey) (ne $k $urlKey)}}
<li><em>{{$k}}:</em> {{index $m $k}}</li>
{{end}}
{{end}}
</ul>
{{end}}
{{recipeSteps .recipe .path}}
<h2>{{.ingredientsTitle}}</h2>
<ul>
{{range .recipe.Steps}}
{{range .Ingredients}}
<li>{{.Name}} {{if ne .Amount.QuantityRaw ""}}({{.Amount.QuantityRaw}}{{if ne .Amount.Unit ""}} {{.Amount.Unit}}{{end}}){{end}}</li>
{{end}}
{{end}}
</ul>
</div>
</main>
</body>
</html>