
<!-- TOP BEGIN -->
<%
  const
    getPageField = (field_name) => {
      return page[field_name] || site[field_name] || '';
    },
    getUrl = () => site.base_uri + (site.base_uri.endsWith('/') ? '' : '/') + page.path;
-%>
<!doctype html>
<!--[if lt IE 7]>      <html class="no-js ie lt-ie10 lt-ie9 lt-ie8 lt-ie7" lang="en" xmlns:fb="http://ogp.me/ns/fb#"> <![endif]-->
<!--[if IE 7]>         <html class="no-js ie lt-ie10 lt-ie9 lt-ie8" lang="en" xmlns:fb="http://ogp.me/ns/fb#"> <![endif]-->
<!--[if IE 8]>         <html class="no-js ie lt-ie10 lt-ie9" lang="en" xmlns:fb="http://ogp.me/ns/fb#"> <![endif]-->
<!--[if IE 9]>         <html class="no-js ie lt-ie10" lang="en" xmlns:fb="http://ogp.me/ns/fb#"> <![endif]-->
<!--[if gt IE 9]> <html class="no-js ie" lang="en" xmlns:fb="http://ogp.me/ns/fb#"> <![endif]-->
<!--[if !IE]>--> <html class="no-js" lang="en" xmlns:fb="http://ogp.me/ns/fb#"> <!--<![endif]-->
<head>
	<meta charset="utf-8" />
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1">
	<base href="<%= getUrl() %>" />
  <title><%= page.title ? page.title + ' | ' : ''%><%= page.sub_title ? page.sub_title + ' | ' : ''%><%= site.title %></title>

  <link rel="pgpkey" type="application/pgp-keys" title="PGP Public Key" href="/files/public.aexpk" />

  <!-- Courtesy of https://www.favicon-generator.org/ -->
  <link rel="apple-touch-icon" sizes="57x57" href="/images/favicons/apple-icon-57x57.png">
  <link rel="apple-touch-icon" sizes="60x60" href="/images/favicons/apple-icon-60x60.png">
  <link rel="apple-touch-icon" sizes="72x72" href="/images/favicons/apple-icon-72x72.png">
  <link rel="apple-touch-icon" sizes="76x76" href="/images/favicons/apple-icon-76x76.png">
  <link rel="apple-touch-icon" sizes="114x114" href="/images/favicons/apple-icon-114x114.png">
  <link rel="apple-touch-icon" sizes="120x120" href="/images/favicons/apple-icon-120x120.png">
  <link rel="apple-touch-icon" sizes="144x144" href="/images/favicons/apple-icon-144x144.png">
  <link rel="apple-touch-icon" sizes="152x152" href="/images/favicons/apple-icon-152x152.png">
  <link rel="apple-touch-icon" sizes="180x180" href="/images/favicons/apple-icon-180x180.png">
  <link rel="icon" type="image/png" sizes="192x192"  href="/images/favicons/android-icon-192x192.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicons/favicon-32x32.png">
  <link rel="icon" type="image/png" sizes="96x96" href="/images/favicons/favicon-96x96.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicons/favicon-16x16.png">
  <link rel="manifest" href="/manifest.json">
  <meta name="msapplication-TileColor" content="#9aa8bc">
  <meta name="msapplication-TileImage" content="/images/favicons/ms-icon-144x144.png">
  <meta name="theme-color" content="#9aa8bc">

  <meta name="description" content="<%= getPageField('description') %>">
  <meta name="author" content="<%= (page.author || site.author).name %>">
  <meta name="generator" content="Gulp"/>
  <meta name="keywords" content="<%= getPageField('keywords') %>">
  <meta name="robots" content="<%= getPageField('robots') %>">

  <!-- Open Graph -->
  <meta property="og:type" content="website" />
  <meta property="og:url" content="<%= site.base_uri %><%= page.path %>" />
  <meta property="og:site_name" content="<%= site.title %>" />
  <meta property="og:title" content="<%= getPageField('title') %>" />
<% if (page.image) { %>
  <meta property="og:image" content="<%= page.image %>"/>
<% } %>
<% if (page.description) { %>
  <meta property="og:description" content="<%= page.description %>" />
<% } %>

  <!-- Twitter Card -->
<% if (page.image) { %>
  <meta name="twitter:card" content="summary_large_image" />
<% } else { %>
  <meta name="twitter:card" content="summary" />
<% } %>
  <meta name="twitter:url" content="<%= site.base_uri %><%= page.path %>" />
  <meta name="twitter:title" content="<%= getPageField('title') %>" />
  <meta name="twitter:description" content="<%= getPageField('description') %>" />
  <meta name="twitter:image:src" content="<%= getPageField('image') %>" />
<% if (page.author && page.author.twitter) { %>
  <meta name="twitter:creator" content="<%= page.author.twitter %>" />
<% } else if (site.author && site.author.twitter) { %>
  <meta name="twitter:creator" content="<%= site.author.twitter %>" />
<% } %>
  <link rel="start" href="<%= site.base_uri %>/"/>
  <link rel="contents" href="/sitemap.xml" title="Sitemap"/>
  <link rel="alternate" type="application/rss+xml" title="Recent Changes" href="/feed"/>
  <link rel="canonical" href="<%= site.base_uri %><%= page.path %>"/>

	<link rel="stylesheet" href="/styles/imports.css" type="text/css" />
	<link rel="stylesheet" href="/styles/fonts.css" type="text/css" />
	<link rel="stylesheet" href="/styles/styles.css" type="text/css" />
</head>

<!-- TOP END -->
