<!DOCTYPE HTML>
<html lang="{{ .Site.Language.Lang }}" dir="{{ $.Param "contentdir" | default "zh" }}">
<head>
  <meta charset="UTF-8" />
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" /> 
  <meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests" />
  <title>{{if .IsHome }} {{ .Site.Title}} {{ else }} {{ .Title }} - {{ .Site.Title }} {{ end }}</title>
  {{ if .Keywords }}
  <meta name="keywords" content="{{ range .Keywords }}{{ . }},{{ end }}">
  {{ else }}
  <meta name="keywords" content="{{ .Site.Params.Keywords }}">
  {{ end }}
  {{ with .Site.Params.AuthorName }}
  <meta name="author" content="{{ . }}">
  {{ end }}
  <meta property="og:title" content="{{ if ne .Permalink " / " }}{{ .Title }}{{else}}{{ .Site.Title }}{{end}}"/>
  <meta property="og:site_name" content="{{ .Site.Title }}">
  <meta property="og:image" content="/img/author.jpg"> 
  <meta name="title" content="{{ if ne .Permalink " / " }}{{ .Title }} - {{ end }}{{ .Site.Title }}" />
  {{ with .Description }}
  <meta name="description" content="{{ . }}" />
  {{ else }}
  <meta name="description" content="{{ .Site.Params.Description }}">
  {{ end }} 
  <link rel="shortcut icon" href="/kols/img/icon.png" />
  <link rel="apple-touch-icon" href="/kols/img/apple-touch-icon.png" />
  <link rel="apple-touch-icon-precomposed" href="/kols/img/apple-touch-icon.png" />
  <link href="//cdn.bootcdn.net/ajax/libs/font-awesome/4.6.2/css/font-awesome.min.css" rel="stylesheet" type="text/css" />
  {{ if .IsPage }}
  <link href="//cdn.bootcdn.net/ajax/libs/imageviewer/0.1.0/viewer.min.css" rel="stylesheet"/>
  {{ end }}
  <link href="/kols/css/main.css" rel="stylesheet" type="text/css" />
  <link href="/kols/css/syntax.css" rel="stylesheet" type="text/css" />    
  {{ if isset .Site.Params.Statis "baidusiteid" }}
  <!-- Baidu tongji -->
  <script type="text/javascript">
    var _hmt = _hmt || [];
    (function() {
      var hm = document.createElement("script");
      hm.src = "https://hm.baidu.com/hm.js?{{ .Site.Params.Statis.BaiduSiteId }}";
      var s = document.getElementsByTagName("script")[0]; 
      s.parentNode.insertBefore(hm, s);
    })();
  </script>
  <!-- Baidu tongji -->
  {{ end }}
  {{ if isset .Site.Params.Statis "googlesiteid" }}
  <!-- Google Analytics -->
  <script async src="https://www.googletagmanager.com/gtag/js?id={{ .Site.Params.Statis.GoogleSiteId }}"></script>
  <script type="text/javascript">
    window.dataLayer = window.dataLayer || [];
    function gtag(){dataLayer.push(arguments);}
    gtag('js', new Date());

    gtag('config', '{{ .Site.Params.Statis.GoogleSiteId }} ');
  </script>
  <!-- Google Analytics -->
  {{ end }}
</head>