<!DOCTYPE html>

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

<head>
<link rel="manifest" href="https://blog.caozhiming.tk/manifest.json"/>
<link rel="icon" href="https://cdn.jsdelivr.net/gh/cao-zhiming/ss-caozhimingtk/img/logo.png"/>
<link rel='stylesheet' id='wp-dark-mode-frontend-css'  href='https://cdn.jsdelivr.net/gh/cao-zhiming/ss-caozhimingtk@0.9.4/css/frontend.css' media='all' />
<script src='https://cdn.jsdelivr.net/gh/cao-zhiming/ss-caozhimingtk@0.9.4/js/dark-mode.js' id='wp-dark-mode-js-js'></script>
<meta name="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" sizes="192x192" 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>
<link rel='stylesheet' id='wp-dark-mode-frontend-css'  href='https://cdn.jsdelivr.net/gh/cao-zhiming/ss-caozhimingtk@0.9.4/css/frontend.css' media='all' />
<script src='https://cdn.jsdelivr.net/gh/cao-zhiming/ss-caozhimingtk@0.9.4/js/dark-mode.js' id='wp-dark-mode-js-js'></script>
<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>
<script>
                    (function () {
                        window.wpDarkMode = {"config":{"brightness":100,"contrast":90,"sepia":10},"enable_preset":false,"customize_colors":false,"colors":{"bg":"#000","text":"#dfdedb","link":"#e58c17"},"enable_frontend":true,"enable_backend":false,"enable_os_mode":true,"excludes":"rs-fullwidth-wrap,.mejs-container","includes":"","is_excluded":false,"remember_darkmode":false,"default_mode":false,"keyboard_shortcut":true,"images":"","is_pro_active":false,"is_ultimate_active":false,"pro_version":0,"is_elementor_editor":false,"is_block_editor":false,"frontend_mode":false};
                        const is_saved = localStorage.getItem('wp_dark_mode_active');

                        const isCustomColor = parseInt("");

                        if ((is_saved && is_saved != 0) || (!is_saved && wpDarkMode.default_mode)) {
                            document.querySelector('html').classList.add('wp-dark-mode-active');

                            //preload CSS
                            if (!isCustomColor) {
                                var css = `body, div, section, header, article, main, aside{background-color: #2B2D2D !important;}`;

                                var head = document.head || document.getElementsByTagName('head')[0],
                                    style = document.createElement('style');

                                style.setAttribute('id', 'pre_css');

                                head.appendChild(style);

                                style.type = 'text/css';
                                if (style.styleSheet) {
                                    // This is required for IE8 and below.
                                    style.styleSheet.cssText = css;
                                } else {
                                    style.appendChild(document.createTextNode(css));
                                }
                            }

                        }
                    })();
                </script>
</head>

<body class="mdui-drawer-body-left">

  <%- 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') %>
  <script>
                ;(function () {
                    //Handle excludes
                    if ('' !== `rs-fullwidth-wrap,.mejs-container`) {
                        const elements = document.querySelectorAll(`rs-fullwidth-wrap,.mejs-container`);

                        elements.forEach((element) => {
                            element.classList.add('wp-dark-mode-ignore');
                            const children = element.querySelectorAll('*');

                            children.forEach((child) => {
                                child.classList.add('wp-dark-mode-ignore');
                            });
                        });
                    }

                    //handle includes
                    if ('' !== ``) {
                        const elements = document.querySelectorAll(``);

                        elements.forEach((element) => {
                            element.classList.add('wp-dark-mode-include');
                            const children = element.querySelectorAll('*');

                            children.forEach((child) => {
                                child.classList.add('wp-dark-mode-include');
                            })
                        });
                    }

                    //Font size toggle
                    ;(function () {
                        const toggle = document.querySelector('.wp-dark-mode-font-size-toggle');

                        if (!toggle) {
                            return;
                        }

                        const isActive = localStorage.getItem('wp_dark_mode_large_font');

                        if ('true' === isActive) {
                            document.querySelector('body').classList.add('wp-dark-mode-large-font');
                            toggle.classList.add('active');
                        }

                    })();
                })();
            </script>

			
                <script>
                    ;(function () {

                        window.wpDarkMode = {"config":{"brightness":100,"contrast":90,"sepia":10},"enable_preset":false,"customize_colors":false,"colors":{"bg":"#000","text":"#dfdedb","link":"#e58c17"},"enable_frontend":true,"enable_backend":false,"enable_os_mode":true,"excludes":"rs-fullwidth-wrap,.mejs-container","includes":"","is_excluded":false,"remember_darkmode":false,"default_mode":false,"keyboard_shortcut":true,"images":"","is_pro_active":false,"is_ultimate_active":false,"pro_version":0,"is_elementor_editor":false,"is_block_editor":false,"frontend_mode":false};
                        const is_saved = localStorage.getItem('wp_dark_mode_active');

                        if ((is_saved && is_saved != 0) || (!is_saved && wpDarkMode.default_mode)) {
                            const isCustomColor = parseInt("");

                            if (!isCustomColor) {

                                //remove preload css
                                if (document.getElementById('pre_css')) {
                                    document.getElementById('pre_css').remove();
                                }

                                if ('' === ``) {
                                    DarkMode.enable();

                                }
                            }
                        }
                    })();


                </script>
			<div class="wp-dark-mode-switcher wp-dark-mode-ignore style-3   floating right_bottom">

	
    <label for="wp-dark-mode-switch" class="wp-dark-mode-ignore wp-dark-mode-none">
        <img class="sun-light" src="https://cdn.jsdelivr.net/gh/cao-zhiming/ss-caozhimingtk@0.9.4/img/sun.svg" alt="Light">

        <div class="toggle wp-dark-mode-ignore"></div>

        <img class="moon-light" src="https://cdn.jsdelivr.net/gh/cao-zhiming/ss-caozhimingtk@0.9.4/img/moon.svg" alt="Dark">
    </label>

  <%- partial('_partial/analytics') %>
  <script src='https://cdn.jsdelivr.net/gh/cao-zhiming/ss-caozhimingtk@0.9.4/js/frontend.js' id='wp-dark-mode-frontend-js'></script>
</body>

</html>
