185 lines
15 KiB
Plaintext
Executable File
185 lines
15 KiB
Plaintext
Executable File
<head>
|
|
<meta charset="utf-8">
|
|
<!--
|
|
© Material Theme
|
|
https://github.com/viosey/hexo-theme-material
|
|
Version: 1.4.0 -->
|
|
<script>window.materialVersion = "1.4.0"</script>
|
|
|
|
<!-- Title -->
|
|
<%
|
|
var title = page.title;
|
|
|
|
if (is_archive()) {
|
|
title = __('sidebar.archive');
|
|
|
|
if (is_month()) {
|
|
title += ': ' + page.year + '/' + page.month;
|
|
}
|
|
else if (is_year()) {
|
|
title += ': ' + page.year;
|
|
}
|
|
}
|
|
else if (is_category()) {
|
|
title = __('title.category') + ': ' + page.category;
|
|
}
|
|
else if (is_tag()) {
|
|
title = __('title.tag') + ': ' + page.tag;
|
|
}
|
|
%>
|
|
<title>
|
|
<% if (title) { %>
|
|
<%= title + ' | ' %>
|
|
<% } %>
|
|
<%= config.title %>
|
|
</title>
|
|
|
|
<!-- dns prefetch -->
|
|
<meta http-equiv="x-dns-prefetch-control" content="on">
|
|
<% if(theme.materialcdn.use === true) { %>
|
|
<link rel="dns-prefetch" href="<%= theme.materialcdn.base %>"/>
|
|
<%}%>
|
|
<% if(theme.leancloud.enable === true) { %>
|
|
<link rel="dns-prefetch" href="<%= theme.leancloud.av_core_mini %>"/>
|
|
<% } %>
|
|
<% if(theme.comment.use == "changyan"){ %>
|
|
<link rel="dns-prefetch" href="https://changyan.sohu.com"/>
|
|
<% } %>
|
|
<% if(theme.analytics.use === "baidu") { %>
|
|
<link rel="dns-prefetch" href="https://hm.baidu.com"/>
|
|
<% } %>
|
|
<% if(theme.analytics.use === "google") { %>
|
|
<link rel="dns-prefetch" href="https://www.google-analytics.com"/>
|
|
<% } %>
|
|
<% if(theme.analytics.use === "cnzz") { %>
|
|
<link rel="dns-prefetch" href="https://s95.cnzz.com"/>
|
|
<% } %>
|
|
<% if(theme.busuanzi.enable === true) { %>
|
|
<link rel="dns-prefetch" href="https://busuanzi.ibruce.info"/>
|
|
<% } %>
|
|
<% if(theme.fonts.host === "google") { %>
|
|
<link rel="dns-prefetch" href="https://fonts.googleapis.com"/>
|
|
<link rel="dns-prefetch" href="https://fonts.gstatic.com"/>
|
|
<% } %>
|
|
<% if(theme.fonts.host === "baomitu") { %>
|
|
<link rel="dns-prefetch" href="https://lib.baomitu.com"/>
|
|
<% } %>
|
|
<% if(theme.qrcode.use === "online" && theme.qrcode.enable === "true") { %>
|
|
<link rel="dns-prefetch" href="https://pan.baidu.com"/>
|
|
<% } %>
|
|
|
|
<!-- Meta & Info -->
|
|
<meta http-equiv="X-UA-Compatible">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
|
|
<meta name="theme-color" content="<%= theme.uiux.android_chrome_color %>">
|
|
<meta name="author" content="<%= config.author %>">
|
|
<meta name="description" itemprop="description" content="<% if(page.description) { %><%= page.description %><% } else if(page.excerpt){ %><%= strip_html(page.excerpt).replace(/^s*/, '').replace(/s*$/, '') %><% } else if (config.description){ %><%= config.description %><% } %>">
|
|
<meta name="keywords" content="<%= theme.head.keywords %><% if(page.tags && page.tags.each) { page.tags.each(function(tag) { %><%- ',' + tag.name %><% })} %>">
|
|
|
|
<!-- Site Verification -->
|
|
<% if(theme.head.site_verification.google) { %><meta name="google-site-verification" content="<%= theme.head.site_verification.google %>" /><% } %>
|
|
<% if(theme.head.site_verification.baidu) { %><meta name="baidu-site-verification" content="<%= theme.head.site_verification.baidu %>" /><% } %>
|
|
|
|
<!-- Favicons -->
|
|
<link rel="icon shortcut" type="image/ico" href="<%= theme.head.favicon %>">
|
|
<link rel="icon" sizes="192x192" href="<%= theme.head.high_res_favicon %>">
|
|
<link rel="apple-touch-icon" href="<%= theme.head.apple_touch_icon %>">
|
|
|
|
<!--iOS -->
|
|
<meta name="apple-mobile-web-app-title" content="Title">
|
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
|
<meta name="apple-mobile-web-app-status-bar-style" content="black">
|
|
<meta name="HandheldFriendly" content="True">
|
|
<meta name="MobileOptimized" content="480">
|
|
|
|
<!-- Add to homescreen for Chrome on Android -->
|
|
<meta name="mobile-web-app-capable" content="yes">
|
|
|
|
<!-- Add to homescreen for Safari on iOS -->
|
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
|
<meta name="apple-mobile-web-app-status-bar-style" content="black">
|
|
<meta name="apple-mobile-web-app-title" content="<%= config.title %>">
|
|
|
|
<!-- The Open Graph protocol -->
|
|
<meta property="og:url" content="<%= config.url %>">
|
|
<meta property="og:type" content="blog">
|
|
<meta property="og:title" content="<% if (title) { %><%= title %> | <% } %><%= config.title %>">
|
|
<meta property="og:image" content="<%= theme.head.high_res_favicon %>" />
|
|
<meta property="og:description" content="<% if(page.description) { %><%= page.description %><% } else if(page.excerpt){ %><%= strip_html(page.excerpt).replace(/^s*/, '').replace(/s*$/, '') %><% } else if (config.description){ %><%= config.description %><% } %>">
|
|
<% if(page.tags && page.tags.each) { page.tags.each(function(tag){ %><meta property="og:article:tag" content="<%= tag.name %>"> <% })} %>
|
|
|
|
<% if( (is_post()) ) { %>
|
|
<meta property="article:published_time" content="<%= date(page.date, 'MMM DD, YYYY') %>" />
|
|
<meta property="article:modified_time" content="<%= date(page.updated, 'MMM DD, YYYY') %>" />
|
|
<% } %>
|
|
|
|
<!-- The Twitter Card protocol -->
|
|
<meta name="twitter:title" content="<% if (title) { %><%= title %> | <% } %><%= config.title %>">
|
|
<meta name="twitter:description" content="<% if(page.description) { %><%= page.description %><% } else if(page.excerpt){ %><%= strip_html(page.excerpt).replace(/^s*/, '').replace(/s*$/, '') %><% } else if (config.description){ %><%= config.description %><% } %>">
|
|
<meta name="twitter:image" content="<%= theme.head.high_res_favicon %>">
|
|
<meta name="twitter:card" content="summary_large_image" />
|
|
<meta name="twitter:url" content="<%= config.url %>" />
|
|
|
|
<!-- Add canonical link for SEO -->
|
|
<% if( (page.current === 1) && (is_home()) ) { %>
|
|
<link rel="canonical" href="<%- config.url %>" />
|
|
<% } else { %>
|
|
<link rel="canonical" href="<%- config.url + url_for(path) %>" />
|
|
<% } %>
|
|
|
|
<!-- Structured-data for SEO -->
|
|
<% if(theme.head.structured_data === true) { %>
|
|
<%- partial('_partial/structured-data') %>
|
|
<% } %>
|
|
|
|
<!--[if lte IE 9]>
|
|
<link rel="stylesheet" href="/css/ie-blocker.css">
|
|
|
|
<% if(config.language === 'zh-CN') { %>
|
|
<script src="/js/ie-blocker.zhCN.js"></script>
|
|
<% } else { %>
|
|
<script src="/js/ie-blocker.en.js"></script>
|
|
<% } %>
|
|
<![endif]-->
|
|
|
|
<!-- Import lsloader -->
|
|
<script>(function(){window.lsloader={jsRunSequence:[],jsnamemap:{},cssnamemap:{}};lsloader.removeLS=function(key){try{localStorage.removeItem(key)}catch(e){}};lsloader.setLS=function(key,val){try{localStorage.setItem(key,val)}catch(e){}};lsloader.getLS=function(key){var val="";try{val=localStorage.getItem(key)}catch(e){val=""}return val};versionString="/*"+materialVersion+"*/";lsloader.clean=function(){try{var keys=[];for(var i=0;i<localStorage.length;i++){keys.push(localStorage.key(i))}keys.forEach(function(key){var data=lsloader.getLS(key);if(data&&data.indexOf(versionString)===-1){lsloader.removeLS(key)}})}catch(e){}};lsloader.clean();lsloader.load=function(jsname,jspath,cssonload){cssonload=cssonload||function(){};var code;code=this.getLS(jsname);if(code&&code.indexOf(versionString)===-1){this.removeLS(jsname);this.requestResource(jsname,jspath,cssonload);return}if(code){var versionNumber=code.split(versionString)[0];if(versionNumber!=jspath){console.log("reload:"+jspath);this.removeLS(jsname);this.requestResource(jsname,jspath,cssonload);return}code=code.split(versionString)[1];if(/\.js?.+$/.test(versionNumber)){this.jsRunSequence.push({name:jsname,code:code});this.runjs(jspath,jsname,code)}else{document.getElementById(jsname).appendChild(document.createTextNode(code));cssonload()}}else{this.requestResource(jsname,jspath,cssonload)}};lsloader.requestResource=function(name,path,cssonload){var that=this;if(/\.js?.+$/.test(path)){this.iojs(path,name,function(path,name,code){that.setLS(name,path+versionString+code);that.runjs(path,name,code)})}else if(/\.css?.+$/.test(path)){this.iocss(path,name,function(code){document.getElementById(name).appendChild(document.createTextNode(code));that.setLS(name,path+versionString+code)},cssonload)}};lsloader.iojs=function(path,jsname,callback){var that=this;that.jsRunSequence.push({name:jsname,code:""});try{var xhr=new XMLHttpRequest;xhr.open("get",path,true);xhr.onreadystatechange=function(){if(xhr.readyState==4){if(xhr.status>=200&&xhr.status<300||xhr.status==304){if(xhr.response!=""){callback(path,jsname,xhr.response);return}}that.jsfallback(path,jsname)}};xhr.send(null)}catch(e){that.jsfallback(path,jsname)}};lsloader.iocss=function(path,jsname,callback,cssonload){var that=this;try{var xhr=new XMLHttpRequest;xhr.open("get",path,true);xhr.onreadystatechange=function(){if(xhr.readyState==4){if(xhr.status>=200&&xhr.status<300||xhr.status==304){if(xhr.response!=""){callback(xhr.response);cssonload();return}}that.cssfallback(path,jsname,cssonload)}};xhr.send(null)}catch(e){that.cssfallback(path,jsname,cssonload)}};lsloader.iofonts=function(path,jsname,callback,cssonload){var that=this;try{var xhr=new XMLHttpRequest;xhr.open("get",path,true);xhr.onreadystatechange=function(){if(xhr.readyState==4){if(xhr.status>=200&&xhr.status<300||xhr.status==304){if(xhr.response!=""){callback(xhr.response);cssonload();return}}that.cssfallback(path,jsname,cssonload)}};xhr.send(null)}catch(e){that.cssfallback(path,jsname,cssonload)}};lsloader.runjs=function(path,name,code){if(!!name&&!!code){for(var k in this.jsRunSequence){if(this.jsRunSequence[k].name==name){this.jsRunSequence[k].code=code}}}if(!!this.jsRunSequence[0]&&!!this.jsRunSequence[0].code&&this.jsRunSequence[0].status!="failed"){var script=document.createElement("script");script.appendChild(document.createTextNode(this.jsRunSequence[0].code));script.type="text/javascript";document.getElementsByTagName("head")[0].appendChild(script);this.jsRunSequence.shift();if(this.jsRunSequence.length>0){this.runjs()}}else if(!!this.jsRunSequence[0]&&this.jsRunSequence[0].status=="failed"){var that=this;var script=document.createElement("script");script.src=this.jsRunSequence[0].path;script.type="text/javascript";this.jsRunSequence[0].status="loading";script.onload=function(){that.jsRunSequence.shift();if(that.jsRunSequence.length>0){that.runjs()}};document.body.appendChild(script)}};lsloader.tagLoad=function(path,name){this.jsRunSequence.push({name:name,code:"",path:path,status:"failed"});this.runjs()};lsloader.jsfallback=function(path,name){if(!!this.jsnamemap[name]){return}else{this.jsnamemap[name]=name}for(var k in this.jsRunSequence){if(this.jsRunSequence[k].name==name){this.jsRunSequence[k].code="";this.jsRunSequence[k].status="failed";this.jsRunSequence[k].path=path}}this.runjs()};lsloader.cssfallback=function(path,name,cssonload){if(!!this.cssnamemap[name]){return}else{this.cssnamemap[name]=1}var link=document.createElement("link");link.type="text/css";link.href=path;link.rel="stylesheet";link.onload=link.onerror=cssonload;var root=document.getElementsByTagName("script")[0];root.parentNode.insertBefore(link,root)};lsloader.runInlineScript=function(scriptId,codeId){var code=document.getElementById(codeId).innerText;this.jsRunSequence.push({name:scriptId,code:code});this.runjs()};lsloader.loadCombo=function(jslist){var updateList="";var requestingModules={};for(var k in jslist){var LS=this.getLS(jslist[k].name);if(!!LS){var version=LS.split(versionString)[0];var code=LS.split(versionString)[1]}else{var version=""}if(version==jslist[k].path){this.jsRunSequence.push({name:jslist[k].name,code:code,path:jslist[k].path})}else{this.jsRunSequence.push({name:jslist[k].name,code:null,path:jslist[k].path,status:"comboloading"});requestingModules[jslist[k].name]=true;updateList+=(updateList==""?"":";")+jslist[k].path}}var that=this;if(!!updateList){var xhr=new XMLHttpRequest;xhr.open("get",combo+updateList,true);xhr.onreadystatechange=function(){if(xhr.readyState==4){if(xhr.status>=200&&xhr.status<300||xhr.status==304){if(xhr.response!=""){that.runCombo(xhr.response,requestingModules);return}}else{for(var i in that.jsRunSequence){if(requestingModules[that.jsRunSequence[i].name]){that.jsRunSequence[i].status="failed"}}that.runjs()}}};xhr.send(null)}this.runjs()};lsloader.runCombo=function(comboCode,requestingModules){comboCode=comboCode.split("/*combojs*/");comboCode.shift();for(var k in this.jsRunSequence){if(!!requestingModules[this.jsRunSequence[k].name]&&!!comboCode[0]){this.jsRunSequence[k].status="comboJS";this.jsRunSequence[k].code=comboCode[0];this.setLS(this.jsRunSequence[k].name,this.jsRunSequence[k].path+versionString+comboCode[0]);comboCode.shift()}}this.runjs()}})();</script>
|
|
|
|
<!-- Import CSS & jQuery -->
|
|
<% if(theme.materialcdn.use === true) { %>
|
|
<%- cssLsload({path:(theme.materialcdn.base + '/css/material.min.css'),key:'css/material.min.css'}) %>
|
|
<%- cssLsload({path:(theme.materialcdn.base + '/css/style.min.css'),key:'css/style.min.css'}) %>
|
|
<% if(theme.scheme === 'Isolation') { %>
|
|
<%- cssLsload({path:(theme.materialcdn.base + '/css/fontawesome.min.css'),key:'css/fontawesome.min.css'}) %>
|
|
<% } %>
|
|
<% if(theme.scheme === 'Paradox') { %>
|
|
<%- partial('_partial/config_footer') %>
|
|
<% } %>
|
|
<%- partial('_partial/config_css') %>
|
|
<%- jsLsload({path:(theme.materialcdn.base + '/js/jquery.min.js'),key:'js/jquery.min.js'}) %>
|
|
<%}else{%>
|
|
<%- cssLsload('css/material.min.css') %>
|
|
<%- cssLsload('css/style.min.css') %>
|
|
<% if(theme.scheme === 'Isolation') { %>
|
|
<%- cssLsload('/css/fontawesome.min.css') %>
|
|
<% } %>
|
|
<% if(theme.scheme === 'Paradox') { %>
|
|
<%- partial('_partial/config_footer') %>
|
|
<% } %>
|
|
<%- partial('_partial/config_css') %>
|
|
<%- jsLsload('js/jquery.min.js') %>
|
|
<%}%>
|
|
|
|
<script>function Queue(){this.dataStore=[];this.offer=b;this.poll=d;this.execNext=a;this.debug=false;this.startDebug=c;function b(e){if(this.debug){console.log("Offered a Queued Function.")}if(typeof e==="function"){this.dataStore.push(e)}else{console.log("You must offer a function.")}}function d(){if(this.debug){console.log("Polled a Queued Function.")}return this.dataStore.shift()}function a(){var e=this.poll();if(e!==undefined){if(this.debug){console.log("Run a Queued Function.")}e()}}function c(){this.debug=true}}var queue=new Queue();</script>
|
|
|
|
<!-- Analytics -->
|
|
<% if(theme.analytics.use) { %><%- partial('_widget/analytics/' + theme.analytics.use + '-analytics') %><% } %>
|
|
|
|
<!-- Custom Head -->
|
|
<% if (site.data.head) { %>
|
|
<% for (var i in site.data.head) { %>
|
|
<%- site.data.head[i] %>
|
|
<% } %>
|
|
<% } %>
|
|
</head>
|