blob: 94aaf3d83eb5638b52ea3c966192297c911b8a64 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
|
{{ define "title" }}
{{ .Title }} · {{ .Site.Title }}
{{ end }}
{{ define "content" }}
<div class="container" itemscope itemtype="http://schema.org/Recipe">
<!-- call up the image and image credit link -->
{{ with .Resources.ByType "image" }}
{{ range . }}
<div class="xs-p2">
<img itemprop="image" src="{{$.Site.BaseURL}}{{ .RelPermalink }}" />
</div>
{{ end }}
{{ end }}
<article class="post-content px2">
<!-- call up the main recipe title and content -->
<header class="post-header">
<h1 class="post-title center m1 sm-mt3" itemprop="name">{{ .Title }}</h1>
</header>
<div class="px2 mt3 clearfix">
<div class="sm-col-8 center mx-auto" itemprop="description">{{.Content}}</div>
</div>
<!-- call up recipe and directions -->
<div class="clearfix mt3">
<div class="sm-col sm-col-6 lg-col-6">
<!-- check if it's a component-based recipe -->
{{ with .Params.Components}}
<h4 class="blue mt0 mb2 xs-center">Components</h4>
<ul>
<!-- list components that make up recipe -->
{{ range . }}
<li>
{{ with ( . | markdownify) }}{{ partial "recipe_item.html" . }}{{ end }}
</li>
{{ end }}
</ul>
{{ end }}
{{ with .Params.Ingredients }}
<h4 class="blue mt0 mb2 xs-center">Ingredients</h4>
<ul itemprop="ingredients">
<!-- list ingredients that make up recipe -->
{{ range . }}
<li itemprop="recipeIngredient">
{{ with ( . | markdownify) }}{{ partial "recipe_item.html" . }}{{ end }}
</li>
{{ end }}
</ul>
{{ end }}
</div>
<div class="sm-col sm-col-6 lg-col-6">
<h4 class="blue mt0 mb2 xs-center">Directions</h4>
<ul itemprop="recipeInstructions">
{{ range .Params.Directions }}
<li>
{{ with ( . | markdownify) }}{{ partial "recipe_item.html" . }}{{ end }}</li>
{{ end }}
</ul>
</div>
</div>
<!-- end recipe and directions -->
<!-- check if it's a component-based recipe, render it -->
{{ with .Params.Components }}
<div class="components bg-darken-2 p2 mt3 mb3 center">
↓ This is a <strong class="blue">component-based recipe</strong> (fancy talk for making the dish in pieces, then assembling). ↓
</div>
<div class="clearfix mxn2">
{{ range . }}
{{ $compTitle := . }}
<div class="sm-col sm-col-4 px2">
{{ range where $.Site.Pages "Title" $compTitle }}
<h4 class="blue center">{{ .Title }}</h4>
{{ range (.Resources.ByType "image") }}
<div class="image ratio bg-cover" style="background-image:url({{$.Site.BaseURL}}{{ .RelPermalink }});">
<img class="hide" itemprop="photo" src="{{$.Site.BaseURL}}{{ .RelPermalink }}" />
</div>
{{ end }}
{{ if .Params.Imagecredit }}
<a href="{{ .Params.Imagecredit }}" class="right">
<svg class="js-geomicon geomicon" width="14" height="14" data-icon="camera" viewBox="0 0 32 32" style="fill:currentcolor">
<title>camera icon</title>
<path d="M0 6 L8 6 L10 2 L22 2 L24 6 L32 6 L32 28 L0 28 z M9 17 A7 7 0 0 0 23 17 A7 7 0 0 0 9 17"></path>
</svg>
</a>
{{ end }}
<h4 class="blue regular xs-center">Ingredients</h4>
<ul class="ingredients" itemprop="ingredients">
{{ range .Params.Ingredients }}
<li itemprop="ingredient">
{{ with ( . | markdownify) }}{{ partial "recipe_item.html" . }}{{ end }}
</li>
{{ end }}
</ul>
<h4 class="blue regular xs-center">Steps</h4>
<ul itemprop="instructions">
{{ range .Params.Directions }}
<li>
{{ with ( . | markdownify) }}{{ partial "recipe_item.html" . }}{{ end }}
</li>
{{ end }}
</ul>
{{ end }}
</div>
{{ end }}
</div>
{{ end }}
<!-- end components -->
<br />
{{ with .Params.Category }}{{ partial "taxonomy/category" . }}{{ end }}
{{ with .Params.Cuisine }}{{ partial "taxonomy/cuisine" . }}{{ end }}
{{ with .Params.Tags }}{{ partial "taxonomy/tags" . }}{{ end }}
</article>
</div>
{{ end }}
|