{{ 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 .Params.Image }}
    <div class="xs-p2">
      <img itemprop="image" src="{{ . }}" />
    </div>
  {{ else }}
    {{ range first 1 (.Resources.ByType "image") }}
      <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 mx-auto" itemprop="description">{{.Content}}</div>
    </div>

    <br />

    {{ with .Params.Category }}{{ partial "taxonomy/notes" . }}{{ end }}
    {{ with .Params.Cuisine }}{{ partial "taxonomy/cuisine" . }}{{ end }}
    {{ with .Params.Tags }}{{ partial "taxonomy/tags" . }}{{ end }}

    <div class="recipe-source">
      {{ if (or .Params.SourceName .Params.AuthorName) }}
        {{ i18n "inspired" }}
      {{ end }}

      {{ with .Params.SourceName }}
        {{$name := .}}
        {{ i18n "by" }}
        {{with $.Params.SourceURL }}
          <a href="{{.}}">{{$name}}</a>
         {{else}}
           {{$name}}
         {{end}}
      {{ end }}

      {{with .Params.AuthorName}}
        {{$name := .}}
        {{ i18n "from" }}
        {{with $.Params.AuthorURL }}
          <a href="{{.}}">{{$name}}</a>
         {{else}}
           {{$name}}
         {{end}}
      {{end}}
    </div>
    
  </article>
</div>
{{ end }}
