<!DOCTYPE HTML>
<html>
<head>
  <meta charset="utf-8" />
  <meta name="referrer" content="never" />
  <%
  var title = [];
  if (page.current > 1) title.push(__('page', page.current));
  if (page.title) title.push(page.title);
  if (page.category) title.push(page.category);
  if (page.tag) title.push(page.tag);
  if (page.archive){
    if (page.year) title.push(__('archive_b', page.year + (page.month ? '/' + page.month : '')));
    else title.push(__('archive_a'));
  }
  title.push(config.title);
  %>
  <title><%= title.join(' | ') %></title>
  <% if (config.author){ %><meta name="author" content="<%= config.author %>" /><% } %>

  <% if (page.description){ %>
  <meta name="description" content="<%= page.description %>" />
  <% } else if (config.description){ %>
  <meta name="description" content="<%= config.description %>" />
  <% } else if (page.excerpt){ %>
  <meta name="description" content="<%= strip_html(page.excerpt).replace(/^\s*/, '').replace(/\s*$/, '') %>" />
  <% } else if (page.content){ %>
  <meta name="description" content="<%= strip_html(page.content).replace(/^\s*/, '').replace(/\s*$/, '').substring(0, 150) %>" />
  <% } %>

  <% if (page.keywords){ %>
  <meta name="keywords" content="<%= page.keywords %>" />
  <% } else if(config.keywords) { %>
  <meta name="keywords" content="<%= config.keywords %>" />
  <% } %>

  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />

  <% if (page.title){ %><meta property="og:title" content="<%= page.title %>" /><% } %>
  <meta property="og:site_name" content="<%= config.title %>" />

  <% if (theme.google_site_verification){ %><meta name="google-site-verification" content="<%= theme.google_site_verification%>" /><% } %>
  <% if (theme.baidu_site_verification){ %><meta name="baidu-site-verification" content="<%= theme.baidu_site_verification%>" /><% } %>
  <% if (theme.sogou_site_verification){ %><meta name="sogou_site_verification" content="<%= theme.sogou_site_verification%>" /><% } %>
  <% if (theme.bing_site_verification){ %><meta name="msvalidate.01" content="<%= theme.bing_site_verification%>" /><% } %>
  <% if (theme.haosou_site_verification){ %><meta name="360-site-verification" content="<%= theme.haosou_site_verification%>" /><% } %>

  <% if(page.cover) { %>
    <meta property="og:image" content="<%= page.cover %>" />
  <% } else { %>
    <meta property="og:image" content="<%= config.cover %>" />
  <% } %>

  <% if(theme.icon) { %>
  <link href="<%= theme.icon %>" rel="icon" />
  <% } else { %>
  <link href="<%- config.root %>css/images/favicon.ico" rel="icon" />
  <% } %>

  <link rel="alternate" href="<% if (theme.rss){ %><%- theme.rss %><% } else { %><%- config.root %>atom.xml<% } %>" title="<%= config.title %>" type="application/atom+xml">
  <link rel="stylesheet" href="<%- config.root %>css/style.css" media="screen" type="text/css">
  <!--[if lt IE 9]><script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
  <%- partial('google_analytics') %>

  <!-- baidu webmaster push -->
  <script src='//push.zhanzhang.baidu.com/push.js'></script>

</head>
