#!
PAGE="$1"
SITE_URL="$2"
DATE_PUBLISHED="${DATE_PUBLISHED:-$(basename "${PAGE}" | cut -c1-10)}"
CANONICAL_URL="${SITE_URL}/blog/$(basename "${PAGE}")"
#!

<!doctype html>
<html lang="en-GB">

<head>
#!
pp "${SHARE}"/components/head.upphtml
#!
</head>

<body>

#!
pp "${SHARE}"/components/navbar.upphtml
#!

<article class='h-entry'>

<aside>
<span>This is a blog post by <a class='p-author h-card' href='/'>Joe Carstairs</a>.</span>
#!
if [ -z "${DATE_UPDATED}" ]; then
#!
<span>Published:
#!
DATE="${DATE_PUBLISHED}" CLASS="dt-published" pp "${SHARE}/components/formatted_date.upphtml"
#!
.</span>
#!
else
#!
<span>Updated:
#!
DATE="${DATE_UPDATED}" CLASS="dt-updated" pp "${SHARE}/components/formatted_date.upphtml"
#!
.</span>
<span>Originally published:
#!
DATE="${DATE_PUBLISHED}" CLASS="dt-published" pp "${SHARE}/components/formatted_date.upphtml"
#!
.</span>
#!
fi
#!
<span hidden><a class='u-url uid' href='${CANONICAL_URL}'>Permalink</a></span>
</aside>

<header>
<h1 class='h-name'>${POST_TITLE}</h1>
</header>

<section class='e-content'>
#!
pp "${PAGE}"
#!
</section>

</article>
