{{ define "main" }}
  <article class="post">
    <h1>{{ .Title }}</h1>
    {{ if eq .Type "posts" }}
    <p class="post-meta">
      <time datetime="{{ .Date.Format "2006-01-02" }}">{{ .Date.Format "2 Jan 2006" }}</time>
      {{ with .Params.categories }} · {{ range . }}{{ $cat := . }}{{ with site.GetPage (printf "/categories/%s" (. | urlize)) }}<a class="cat" href="{{ .RelPermalink }}">{{ $cat }}</a>{{ end }} {{ end }}{{ end }}
      {{ with .Params.tags }} · {{ range . }}<span class="tag">{{ . }}</span> {{ end }}{{ end }}
    </p>
    {{ end }}
    {{ .Content }}
  </article>
  <p class="back"><a href="{{ site.Home.RelPermalink }}">← all posts</a></p>
{{ end }}
