{{ define "title" }}{{ .Title }}{{ end }}
{{ define "controls" }}
{{ with .Params.link }}
<a href="{{ . }}"><button aria-label="Maximize"></button></a>
{{ end }}
{{ with .Parent }}
<a href="{{ .Permalink }}"><button aria-label="Close"></button></a>
{{ end }}
{{ end }}
{{ define "main" }}
<main class="inner-window white content">
{{ .Content }}
</main>
{{ end }}
{{ define "status" }}{{ .Description }}{{ end }}
{{ define "footer" }}
    {{ range .Paginator.Pages.ByPublishDate.Reverse }}
        {{ partial "wm/window" (dict "title" .Title "icon" "/img/a39icon.png") }}
        <aside class="inner-window">
            {{ $dateTime := .PublishDate.Format "2006-01-02" }}
            {{ $dateFormat := .Site.Params.dateFormat | default "January 2, 2006" }}
            {{ if .PublishDate }}
                <b>Released</b>: <time datetime="{{ $dateTime }}">{{ .PublishDate.Format $dateFormat }}</time><br/>
            {{ end }}
            {{ with .Params.tags }}
                <b>Tags</b>:
                {{ range . }}
                    {{ $href := print (absURL "projects/tags/") (urlize .) }}
                    #<a href="{{ $href }}">{{ . }}</a>
                {{ end }}<br/>
            {{ end }}
            {{ if .IsTranslated }}
                <b>Translations</b>:
                {{ range .Translations }}
                    <a href="{{ .Permalink }}">{{ .Language.LanguageName }}</a>
                {{ end }}<br/>
            {{ end }}
            {{ if .Params.client }}
                <b>Client</b>: {{ .Params.client }}
            {{ end }}
        </aside>
        <article class="inner-window content">
            <h2><a class="title" href="{{ if .Params.link }}{{ .Params.link }}{{ else }}{{ .RelPermalink }}{{ end }}">{{ .Title }}</a></h2>
            <p>{{ .Content }}</p>
        </article>
        {{ partial "wm/status-bar" .Description }}
        {{ partial "wm/window-end" . }}
    {{ end }}
    {{ template "_internal/pagination.html" . }}
{{ end }}