<!DOCTYPE html>

<html <% if (config.language) { %>lang="<%- config.language %>"<% } %>>

<head>
<link rel="manifest" href="https://blog.caozhiming.tk/manifest.json"/>
<metaname="theme-color"content="#2932e1"/>
  <%
  var title = page.title;

  if (is_archive()){
    title = __('archive');

    if (is_month()){
      title += '：' + page.year + '/' + page.month;
    } else if (is_year()){
      title += '：' + page.year;
    }
  } else if (is_category()){
    title = __('count.categories') + '：' + page.category;
  } else if (is_tag()){
    title = __('count.tags') + '：' + page.tag;
  }
  %>
  <title><% if (title){ %><%= title %> - <% } %><%= config.title %></title>
  <meta charset="UTF-8">
  <meta name="description" content="<%= config.description %>"/>
  <link rel="apple-touch-icon" href="https://blog.caozhiming.tk/ati.png"/>
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=5"/>
  <%- partial('_partial/_analytics/gtm-head') %>
  <%- partial('_partial/site-verification') %>
  <link rel="shortcut icon" href="<%= theme.favicon.href %>" type="<%= theme.favicon.type %>" />
  <%- open_graph({twitter_id: theme.twitter, google_plus: theme.google_plus, fb_admins: theme.fb_admins, fb_app_id: theme.fb_app_id}) %>
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/combine/npm/highlight.js@9.15.8/styles/atom-one-dark.css,npm/justifiedGallery@3.8.1/dist/css/justifiedGallery.min.css,gh/fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.css,npm/hexo-theme-nexmoe@latest/source/lib/mdui_043tiny/css/mdui.css,npm/hexo-theme-nexmoe@latest/source/lib/iconfont/iconfont.css?v=233" crossorigin>
  <%- css_auto_version('css/style') %>
  <% if (theme.iconlib) { %>
    <link rel="stylesheet" href="<%= theme.iconlib %>">
  <% } %>
  <%- css_auto_version('css/style') %>
  <%- css_auto_version('lib/iconfont/iconfont.css') %>
  <script>
var _hmt = _hmt || [];
(function() {
  var hm = document.createElement("script");
  hm.src = "https://hm.baidu.com/hm.js?ddf344a7cdceb371acda23046301210a";
  var s = document.getElementsByTagName("script")[0]; 
  s.parentNode.insertBefore(hm, s);
})();
</script>

</head>

<body class="mdui-drawer-body-left">
<script type='text/javascript'>
if ('serviceWorker' in navigator) {
 window.addEventListener('load', function() {  
   navigator.serviceWorker.register('/sw.js').then(
     function(registration) {
       // Registration was successful
       console.log('ServiceWorker registration successful with scope: ', registration.scope); },
     function(err) {
       // registration failed :(
       console.log('ServiceWorker registration failed: ', err);
     });
 });
}
</script>
  <%- partial('_partial/_analytics/gtm-body') %>
  <div id="nexmoe-background">
    <div class="nexmoe-bg" style="background-image: url(<%= theme.background.path %>)"></div>
    <div class="mdui-appbar mdui-shadow-0">
      <div class="mdui-toolbar">
        <a mdui-drawer="{target: '#drawer', swipe: true}" title="menu" class="mdui-btn mdui-btn-icon mdui-ripple"><i class="mdui-icon nexmoefont icon-menu"></i></a>
        <div class="mdui-toolbar-spacer"></div>
        <!--<a href="javascript:;" class="mdui-btn mdui-btn-icon"><i class="mdui-icon material-icons">search</i></a>-->
        <a href="<%- url_for() %>" title="<%= config.author || config.title %>" class="mdui-btn mdui-btn-icon"><img src="<%= theme.avatar %>" alt="<%= config.author || config.title %>"></a>
       </div>
    </div>
  </div>
  <div id="nexmoe-header">
      <%- partial('_partial/header') %>
  </div>
  <div id="nexmoe-content">
    <div class="nexmoe-primary">
        <%- body %>
        <div class="nexmoe-post-right">
          <div class="nexmoe-fixed">
            <div class="nexmoe-tool"> 
              
                <% if (page.toc || theme.function.globalToc){ %>
                  
                  <% const toc_obj = toc(page.content, {list_number: true}); %>
                  <% if (toc_obj.length > 0) { %>
                    <button class="mdui-fab catalog mdui-ripple" style="overflow:unset;">
                      <i class="nexmoefont icon-i-catalog"></i>
                      <div class="nexmoe-toc">
                        <%- toc_obj %>
                      </div>
                    </button>
                  <% } %>
                    
                <%} %>
              
              <a href="#nexmoe-content" class="toc-link" aria-label="回到顶部" title="top"><button class="mdui-fab mdui-ripple"><i class="nexmoefont icon-caret-top"></i></button></a>
            </div>
          </div>
        </div>
    </div>
  </div>
  <%- partial('_partial/after-footer') %>
  <%- partial('_partial/analytics') %>
</body>

</html>
