sandwitchboard/templates/recipe.html.tmpl

53 lines
1.5 KiB
Cheetah
Raw Normal View History

2024-07-02 01:06:25 +01:00
<!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" />
2024-07-02 01:06:25 +01:00
</head>
<body>
2024-08-03 07:33:58 +01:00
<main>
<div id="content">
2024-08-18 18:27:58 +01:00
<a href="."><---</a>
2024-08-03 07:33:58 +01:00
<h1>{{.name}}</h1>
2024-07-02 01:06:25 +01:00
2024-08-03 07:48:56 +01:00
{{if ne .url ""}}
<a class="recipe-url" href="{{.url}}">External URL</a>
{{end}}
2024-08-03 07:33:58 +01:00
{{$recipeImage := recipeImage .path}}
{{if ne $recipeImage ""}}
<img class="recipeimage" src="{{$recipeImage}}" />
{{end}}
2024-08-03 07:33:58 +01:00
{{if ne (len .recipe.Metadata) 0}}
<ul>
{{$m := .recipe.Metadata}}
{{$nameKey := .nameKey}}
2024-08-03 07:48:56 +01:00
{{$urlKey := .urlKey}}
2024-08-03 07:33:58 +01:00
{{range $k := sortedMetadataKeys $m}}
2024-08-03 07:48:56 +01:00
{{if and (ne $k $nameKey) (ne $k $urlKey)}}
2024-08-03 07:33:58 +01:00
<li><em>{{$k}}:</em> {{index $m $k}}</li>
{{end}}
{{end}}
</ul>
2024-07-06 05:56:57 +01:00
{{end}}
2024-07-02 01:06:25 +01:00
2024-08-03 07:33:58 +01:00
{{recipeSteps .recipe .path}}
2024-07-06 05:56:57 +01:00
2024-08-03 07:33:58 +01:00
<h2>{{.ingredientsTitle}}</h2>
2024-07-06 05:56:57 +01:00
2024-08-03 07:33:58 +01:00
<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>
2024-07-02 01:06:25 +01:00
</body>
</html>