<head>
  <meta http-equiv="content-type" content="text/html; charset=utf-8">
  <meta name="viewport"content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=yes"/>
  <%
    var title = titlecase(page.title);

    if (is_archive()){
      title = 'Archive';
    }
  %>
  <meta name="twitter:card" content="summary_large_image" />
  <meta name="twitter:site" content="@callmepkwu" />
  <meta name="twitter:creator" content="@callmepkwu" />
  <meta property="og:url" content="<%= config.url + '/' + page.path %>" />
  <meta property="og:title" content="<% if (title){ %><%= title %> | <% } %><%= config.title %>" />
  <meta property="og:image" content="https://cdn.patrickwu.space/base/social.png" />
  <title><% if (title){ %>  <%= title %> | <% } %><%= config.title %> </title>

 
  <% if (theme.favicon){ %>
    <link rel="icon" href="<%- url_for(  theme.favicon ) %>">
  <% } %>
  <script async defer data-website-id="251ec8af-4ae1-4a01-ada2-f64e6c2b00ad" src="https://analytics.wedotstud.io/umami.js"></script>
<script type="text/javascript">
  //<![CDATA[
    <% var tmp_list = "";
    site.posts.toArray().forEach((i, ind, array)=>{
      if (i.path !== page.path) {
        tmp_list = tmp_list + '"'+url_for(i.path)+'"';
        if (ind < array.length-1) tmp_list = tmp_list + ',';
      }
    }) %>
  
  (function() {
      window.onload = function() {
        var a = document.getElementById("random");
        a.onclick = function() {
          var posts = [<%- tmp_list %>];
          var random = Math.floor(Math.random() * posts.length);
          window.location.href = posts[random];
          return;
        }
      }
  }());
  //]]>
  </script>
  <%- css(['style', 'https://patrickwu.space/style.css']) %> 
</head>