{{ define "header" }}
  {{ partial "header.html" . }}
{{ end }}

{{ define "main" }}
  <header>
    <h1>{{ .Title }}</h1>
  </header>

  {{ partial "ruby_controls.html" . }}

  {{- $hasContent := false -}}
  {{ with .Content }}
    {{- $hasContent = true -}}
    {{ . }}
  {{ end }}

  {{ if .Params.posts | default true }}
    {{ if $hasContent }}
      <h2>Posts</h2>
    {{ end }}

    {{- range .Pages -}}
      {{ .Render "li_grid_with_date" }}
    {{- end -}}
  {{ end }}
{{ end }}

{{ define "footer" }}
  {{ partial "footer.html" . }}
{{ end }}
