{{ $a := .Author }}
{{ $p := .Post }}

{{ if .IndexView }}
    <a class="h1 blog-title" href="/{{ $p.Fragment }}">{{ $p.Title }}</a>
{{ else }}
    <h1 class="blog-title">{{ $p.Title }}</h1>
{{ end }}

<div class="blog-meta">
    {{ if eq $p.Privacy "private" }}
        <span class="blog-private">[private]</span>
    {{ else if eq $p.Privacy "draft" }}
        <span class="blog-draft">[draft]</span>
    {{ else if eq $p.Privacy "unlisted" }}
        <span class="blog-unlisted">[unlisted]</span>
    {{ end }}
    <span title="{{ $p.Created.Format "Jan 2 2006 @ 15:04:05 MST" }}">
        {{ $p.Created.Format "January 2, 2006" }}
    </span>
    {{ if $p.Updated.After $p.Created }}
        <span title="{{ $p.Updated.Format "Jan 2 2006 @ 15:04:05 MST" }}">
            (updated {{ $p.Updated.Format "January 2, 2006" }})
        </span>
    {{ end }}
    by {{ or $a.Name $a.Username }}
</div>

<div class="markdown mb-4">
    {{ .Rendered }}

    {{ if .Snipped }}
    <p>
        <a href="/{{ $p.Fragment }}#snip">Read more...</a>
    </p>
    {{ end }}
</div>

{{ if $p.Tags }}
    <em class="text-muted float-left pr-3">Tags:</em>
    <ul class="list-inline">
    {{ range $p.Tags }}
        <li class="list-inline-item text-muted"><em><a href="/tagged/{{ . }}">{{ . }}</a></em></li>
    {{ end }}
    </ul>
{{ end }}

{{ if .IndexView }}
    <em class="text-muted">
        <a href="/{{ $p.Fragment }}#comments">{{ .NumComments }} comment{{ if ne .NumComments 1 }}s{{ end }}</a>
        |
        <a href="/{{ $p.Fragment }}">Permalink</a>
    </em>
{{ end }}
