From abdb37c285876493e76c80658a02a772a66fef47 Mon Sep 17 00:00:00 2001 From: XudongX Date: Thu, 30 Apr 2020 19:54:06 +0800 Subject: [PATCH 01/23] supported mathjax --- README.md | 8 ++++++++ _config.yml | 5 +++++ layout/mathjax.ejs | 29 +++++++++++++++++++++++++++++ layout/post.ejs | 3 +++ 4 files changed, 45 insertions(+) create mode 100644 layout/mathjax.ejs diff --git a/README.md b/README.md index 73e4c0a2..609d044d 100644 --- a/README.md +++ b/README.md @@ -247,6 +247,14 @@ about_intro_height: 50 首先备份 archer 下所有你自定义过的文件(包括 _config.yml 和 source 文件夹下添加的文件等),然后删除 archer,再重新安装,最后将备份的文件替换到原来的位置即可。 +## 关于LaTeX支持 + +已经内置mathjax.js,但是需要替换默认的渲染引擎来支持解析LaTeX语法。 +```bash +npm uninstall hexo-renderer-marked --save +npm install hexo-renderer-kramed --save +``` + ## License MIT diff --git a/_config.yml b/_config.yml index 46782b77..8d9c1d79 100755 --- a/_config.yml +++ b/_config.yml @@ -129,3 +129,8 @@ copyright: enable: true # https://creativecommons.org/ license: '本文采用知识共享署名-非商业性使用 4.0 国际许可协议进行许可' + +# MathJax Support +mathjax: + enable: true + cdn: https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.6/MathJax.js?config=TeX-AMS-MML_HTMLorMML \ No newline at end of file diff --git a/layout/mathjax.ejs b/layout/mathjax.ejs new file mode 100644 index 00000000..31e6267f --- /dev/null +++ b/layout/mathjax.ejs @@ -0,0 +1,29 @@ +<% if (theme.mathjax.enable){ %> + + + + + + + +<% } %> \ No newline at end of file diff --git a/layout/post.ejs b/layout/post.ejs index 60091a51..e5620bd6 100644 --- a/layout/post.ejs +++ b/layout/post.ejs @@ -1,4 +1,7 @@
+ <% if (page.mathjax == true){ %> + <%- partial('mathjax') %> + <% } %>
<%- page.content %>
From 953319f0e3331b20fb7b4dcaf78a72c8aecc27e6 Mon Sep 17 00:00:00 2001 From: XudongX Date: Thu, 30 Apr 2020 19:59:06 +0800 Subject: [PATCH 02/23] updated README --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 609d044d..adf356ee 100644 --- a/README.md +++ b/README.md @@ -255,6 +255,8 @@ npm uninstall hexo-renderer-marked --save npm install hexo-renderer-kramed --save ``` +然后就可以配置每篇文章(即.md文件)的头部的`mathjax: true`字段来实现在本篇文章中启用LaTex公式支持。 + ## License MIT From e638323f61822638c5633158f5fc0845a5ab69ee Mon Sep 17 00:00:00 2001 From: akira Date: Fri, 4 Jun 2021 00:41:22 +0800 Subject: [PATCH 03/23] fix bug: Uncaught ReferenceError: process is not defined --- webpack.config.js | 43 +++++++++++++++++++++++++++---------------- webpack.prod.js | 9 ++++----- 2 files changed, 31 insertions(+), 21 deletions(-) diff --git a/webpack.config.js b/webpack.config.js index 1ff9fc18..b11edd8a 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,30 +1,41 @@ const path = require('path') +const webpack = require('webpack') module.exports = { - mode: "development", + mode: 'development', entry: { main: './src/js/main.js', share: './src/js/share.js', - search: './src/js/search.js' + search: './src/js/search.js', }, output: { path: path.resolve(__dirname, 'source/scripts'), - filename: '[name].js' + filename: '[name].js', }, devtool: false, module: { - rules: [{ - test: /\.(js)$/, - exclude: /node_modules/, - use: { - loader: 'babel-loader', - options: { - presets: ['@babel/preset-env'], - plugins: ['@babel/plugin-proposal-class-properties', - '@babel/plugin-proposal-object-rest-spread'] - } + rules: [ + { + test: /\.(js)$/, + exclude: /node_modules/, + use: { + loader: 'babel-loader', + options: { + presets: ['@babel/preset-env'], + plugins: [ + '@babel/plugin-proposal-class-properties', + '@babel/plugin-proposal-object-rest-spread', + ], + }, + }, }, - }] - } + ], + }, + plugins: [ + new webpack.DefinePlugin({ + 'process.env': JSON.stringify({ + DEBUG: undefined, + }), + }), + ], } - diff --git a/webpack.prod.js b/webpack.prod.js index 08caa416..5117500d 100644 --- a/webpack.prod.js +++ b/webpack.prod.js @@ -1,13 +1,12 @@ -const webpack = require('webpack') const { merge } = require('webpack-merge') -const TerserPlugin = require("terser-webpack-plugin"); +const TerserPlugin = require('terser-webpack-plugin') const config = require('./webpack.config.js') module.exports = merge(config, { - mode: "production", - devtool: "source-map", + mode: 'production', + devtool: 'source-map', optimization: { minimize: true, minimizer: [new TerserPlugin()], - } + }, }) From e16f0fbc97b6c37cd2a12f782226a8ea734a1c24 Mon Sep 17 00:00:00 2001 From: akira Date: Fri, 4 Jun 2021 00:51:47 +0800 Subject: [PATCH 04/23] enhance: add dark mode feature --- src/scss/_variables.scss | 3 ++ src/scss/dark.scss | 110 +++++++++++++++++++++++++++++++++++++++ src/scss/style.scss | 1 + 3 files changed, 114 insertions(+) create mode 100644 src/scss/dark.scss diff --git a/src/scss/_variables.scss b/src/scss/_variables.scss index e029842c..3ce74309 100644 --- a/src/scss/_variables.scss +++ b/src/scss/_variables.scss @@ -4,6 +4,7 @@ $feature-color: #f75357; $code-theme: 'atom-one-dark'; // atom-one-dark or atom-one-light // ========== global variables ========== // $body-background-color: #fff; +$body-background-dark-color: #121212; // dark mode color $base-font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, 'PingFang SC', 'Hiragino Sans GB', STHeiti, 'Microsoft YaHei', 'Microsoft JhengHei', 'Source Han Sans SC', 'Noto Sans CJK SC', @@ -42,9 +43,11 @@ $header-border-top-color: rgba(0, 0, 0, 0.75); $profile-width: 200px; // ========== index ========== // $index-post-link-color: #1f1f1f; +$index-post-link-dark-color: #ccc; $index-post-tag-color: #aaa; // ========== post ========== // $post-content-color: #23394d; +$post-content-dark-color: #dfcbb9; // ========== social ========== // $social-iconfont-color: #777; // ========== code ========== // diff --git a/src/scss/dark.scss b/src/scss/dark.scss new file mode 100644 index 00000000..28c717dc --- /dev/null +++ b/src/scss/dark.scss @@ -0,0 +1,110 @@ +// ========== general style ========== // + +@media (prefers-color-scheme: dark) { + body { + background-color: $body-background-dark-color; + } + + .container { + background-color: $body-background-dark-color; + } + + .wrapper { + box-shadow: -3px 0 2px 0 rgba(255, 255, 255, 0.6) !important; + } + + .back-top { + border: 2px solid #fff; + background-color: rgba(18, 18, 18, 0.8); + cursor: pointer; + color: #fff; + &:hover { + background-color: #fff; + color: #121212; + } + } + + .note-warning { + background-color: #222; + } + + .abstract-title { + color: $index-post-link-dark-color !important; + } + + .abstract-content, + .article-entry { + color: $post-content-dark-color !important; + code { + background: #444 !important; + } + blockquote { + background-color: #464646 !important; + } + } + + .license-wrapper { + color: $post-content-dark-color !important; + } + + .header-sidebar-menu-black { + color: #fff !important; + background-color: #121212 !important; + border-color: #fff !important; + &:hover { + background-color: #fff !important; + color: #121212 !important; + } + } + + .toc-wrapper { + .toc-active { + color: $feature-color !important; + } + a { + color: #777 !important; + } + a:hover { + color: $feature-color !important; + } + } + + .footer { + background-color: $body-background-dark-color !important; + } + + .banner { + border-bottom: 1px solid rgba(255, 255, 255, 0.8) !important; + background-color: rgba(0, 0, 0, 0.8) !important; + } + + .blog-title { + a { + color: #fff !important; + &:hover { + color: $feature-color !important; + } + } + } + + .post-title { + a { + color: rgba(255, 255, 255, 0.8) !important; + } + } + + .nextSlogan, + .prevSlogan { + color: #ddd !important; + } + + .popup { + background: #121212 !important; + color: #e1e1e1 !important; + box-shadow: 0px 0px 10px rgba(255, 255, 255, 0.5) !important; + } + .algolia-search { + border-bottom: 1px solid #222 !important; + background: #121212 !important; + } +} diff --git a/src/scss/style.scss b/src/scss/style.scss index 8ec434e3..55d355f0 100644 --- a/src/scss/style.scss +++ b/src/scss/style.scss @@ -2,6 +2,7 @@ @import '_variables'; @import '_normalize'; @import '_common'; +@import 'dark'; @import '_mixin'; // partial From 3cc07c16ee0425908830fbf73c4aa9c1a5132f87 Mon Sep 17 00:00:00 2001 From: akira Date: Fri, 4 Jun 2021 00:59:23 +0800 Subject: [PATCH 05/23] enhancement: add dark mode feature. --- source/css/style.css | 2 +- src/scss/dark.scss | 17 ++++++++++------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/source/css/style.css b/source/css/style.css index b49206d8..dc1fce70 100644 --- a/source/css/style.css +++ b/source/css/style.css @@ -1 +1 @@ -@font-face{font-family:'iconfont-archer';src:url("//at.alicdn.com/t/font_327081_s1wbjxwfu9c.eot");src:url("//at.alicdn.com/t/font_327081_s1wbjxwfu9c.eot?#iefix") format("embedded-opentype"),url("//at.alicdn.com/t/font_327081_s1wbjxwfu9c.woff") format("woff"),url("//at.alicdn.com/t/font_327081_s1wbjxwfu9c.ttf") format("truetype"),url("//at.alicdn.com/t/font_327081_s1wbjxwfu9c.svg#iconfont-archer") format("svg")}.iconfont-archer{font-family:'iconfont-archer' !important;font-size:1rem;font-style:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}/*! normalize.css v3.0.2 | MIT License | git.io/normalize */html{-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:bold}dfn{font-style:italic}h1{font-size:2em;margin:0.67em 0}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace, monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type='checkbox'],input[type='radio']{box-sizing:border-box;padding:0}input[type='number']::-webkit-inner-spin-button,input[type='number']::-webkit-outer-spin-button{height:auto}input[type='searcher']{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}input[type='searcher']::-webkit-searcher-cancel-button,input[type='searcher']::-webkit-searcher-decoration{-webkit-appearance:none}fieldset{border:1px solid #c0c0c0;margin:0 2px;padding:0.35em 0.625em 0.75em}legend{border:0;padding:0}textarea{overflow:auto}optgroup{font-weight:bold}table{border-collapse:collapse;border-spacing:0}td,th{padding:0}html{font-size:16px;font-family:-apple-system,BlinkMacSystemFont,"Helvetica Neue",Arial,"PingFang SC","Hiragino Sans GB",STHeiti,"Microsoft YaHei","Microsoft JhengHei","Source Han Sans SC","Noto Sans CJK SC","Source Han Sans CN","Noto Sans SC","Source Han Sans TC","Noto Sans CJK TC","WenQuanYi Micro Hei",SimSun,sans-serif;overflow-x:hidden}*{font-family:inherit}body{z-index:100;position:relative;background-color:#fff;overflow-x:hidden}.wrapper{z-index:1;display:flex;flex-direction:column;width:100%;min-height:100vh;transition:all 0.3s ease-in 0s;transform:translate3d(0, 0, 0);position:relative;box-shadow:-3px 0 2px 0 rgba(0,0,0,0.6)}.wrapper-sidebar-active{transform:translate3d(400px, 0, 0)}.main{order:1;width:50%;min-width:42.8125rem;flex-grow:0;padding:0 0 0 0;margin-left:3rem}.container{display:flex;padding:3rem 0 0 0;position:relative;background-color:#fff;top:0;left:0;align-items:flex-start;justify-content:center;width:100%;overflow:hidden;transition:all 0.5s ease-out 0s;opacity:1;transform:translate3d(0, 0, 0)}.container-unloaded{opacity:0;transform:translate3d(0, 1rem, 0)}a{text-decoration:none}ul,li{list-style-type:none}.back-top{position:fixed;display:block;left:1rem;bottom:1rem;z-index:10;opacity:0;width:1.5rem;height:1.5rem;text-align:center;line-height:1.5rem;border:2px solid #000;background-color:rgba(255,255,255,0.8);cursor:pointer}.back-top:hover{background-color:#000;color:#fff}.back-top-show{opacity:1;pointer-events:initial}::selection{background:#f75357;color:#eee}::-moz-selection{background:#f75357;color:#eee}::-webkit-selection{background:#f75357;color:#eee}.fancy-link{padding:0 !important;margin:0 !important}.note{padding:0.75rem;border-left:0.35rem solid;border-radius:0.35rem;margin:1.5rem 0}.note-warning{background-color:#fdf8ea;border-color:#f0ad4e}.note-warning .title{font-size:medium;font-weight:500}.site-intro-img{position:absolute;z-index:-1;top:0;left:0;height:calc(100% + 1px);width:100%;filter:brightness(0.5);-webkit-filter:brightness(0.5);-moz-filter:brightness(0.5);background-repeat:no-repeat;background-position:center center;background-size:cover;background-color:transparent}.site-intro-meta{width:100%;height:100%;display:flex;flex-direction:column;justify-content:center;align-items:center}.intro-title,.intro-subtitle{font-family:"Oswald-Regular";color:#fff;margin:0;opacity:0;transition:all 0.5s ease-out 0s;transform:translate(0, -1rem)}.intro-title{font-size:4rem}.intro-subtitle{font-size:2rem;transition-delay:0.5s}.intro-fade-in{opacity:1;transform:translate(0, 0)}.header{position:fixed;top:0;width:100%;height:3.5rem;overflow:hidden;z-index:10;transform:translate3d(0, 0, 0);transition:transform 0.3s ease-in 0s}.header-sidebar-active{transform:translate3d(400px, 0, 0)}.read-progress{width:100%;position:absolute;top:0;left:0;height:3px;background-color:rgba(0,0,0,0.7);transition:transform 0.1s ease-out 0s;transform:translate3d(-100%, 0, 0);z-index:99999}.banner{position:relative;width:100%;margin:0 auto;height:calc(100% - 1px);border-bottom:1px solid rgba(0,0,0,0.8);background-color:rgba(255,255,255,0.8);transform:translate3d(0, -100%, 0);transition:transform 0.3s ease-out 0s}.banner-show{transform:translate3d(0, 0, 0)}.post-title{display:flex;justify-content:center;align-items:center;height:100%;width:70%;margin-left:15%}.post-title a{white-space:nowrap;color:rgba(0,0,0,0.8);line-height:100%;max-width:100%;text-overflow:ellipsis;overflow:hidden;padding-bottom:0.2rem;text-align:center;font-size:1.5rem}.blog-title{display:flex;position:absolute;right:2.5rem;top:50%;transform:translate(0, -50%);justify-content:center;align-items:center;height:100%}.blog-title a{vertical-align:top;white-space:nowrap;color:#000;font:1rem/1rem "Oswald-Regular"}.blog-title a:hover{color:#f75357}.header-sidebar-menu{position:absolute;left:1rem;top:50%;border:2px solid #fff;width:1.5rem;height:1.5rem;transform:translate(0, -50%);transition:transform 0.3s ease;font-family:'iconfont-archer';color:#fff;text-align:center;line-height:1.5rem;z-index:21;cursor:pointer}.header-sidebar-menu:hover{background-color:#fff;color:#000;transform:translate(0, -50%)}.header-sidebar-menu-active{transform:translate(0, -50%) rotate(180deg) !important;transition:transform 0.3s ease}.header-sidebar-menu-black{color:#000;background-color:#fff;border-color:#000}.header-sidebar-menu-black:hover{background-color:#000;color:#fff}.home-link{position:absolute;right:2.5rem;top:50%;transform:translate(0, -50%);font-family:"Oswald-Regular";color:#fff;cursor:pointer}.home-link:hover{color:#f75357}.home-link-hide{display:none}.profile{order:0;vertical-align:top;flex-shrink:0;margin:4px 0 0 0;width:200px;font:1rem "Oswald-Regular";border-bottom:1px solid rgba(0,0,0,0.1);padding-bottom:0.5rem}.profile *{color:#777}.profile>*:last-child{border-bottom:none;padding-bottom:0}.profile-avatar{display:block;border-radius:1rem;width:100%;box-shadow:0 0 2px 0 rgba(0,0,0,0.6)}.profile-name{font-size:2rem;line-height:3rem;padding:0.5rem 0 0 0;color:#333;text-align:center}.profile-signature{font-size:1rem;text-align:center}.profile-social{position:relative;width:100%;text-align:left;line-height:1.7rem;padding:0.5rem 0;border-bottom:1px solid rgba(0,0,0,0.1)}.profile-social .iconfont-archer{position:relative}.profile-social .iconfont-archer{display:inline-block;text-align:center}.profile-social .iconfont-archer::before{display:inline-block;color:#777;font-size:1.5rem;margin:0 .4rem 0 0}.profile-social .iconfont-archer:last-of-child::before{margin:0}.profile-social .email{top:1.5px}.profile-social .email::before{content:'\e642'}.profile-social .email:hover::before{color:#0cb49d}.profile-social .github::before{font-size:1.6rem;content:'\e69f'}.profile-social .github:hover::before{color:#24292e}.profile-social .wechat{top:2px}.profile-social .wechat::before{font-size:1.4rem;content:'\ec7d'}.profile-social .wechat:hover::before{color:#42ae3c}.profile-social .qq{top:2px}.profile-social .qq::before{font-size:1.4rem;content:'\e61d'}.profile-social .qq:hover::before{color:#4f4e71}.profile-social .telegram{top:2px}.profile-social .telegram::before{font-size:1.3rem;content:'\e731'}.profile-social .telegram:hover::before{color:#36a1d3}.profile-social .weibo::before{font-size:1.6rem;content:'\e619'}.profile-social .weibo:hover::before{color:#d52a2a}.profile-social .zhihu{top:1.5px}.profile-social .zhihu::before{font-size:1.35rem;content:'\e61a'}.profile-social .zhihu:hover::before{color:#0f88eb}.profile-social .douban{top:1px}.profile-social .douban::before{font-size:1.25rem;content:'\e605'}.profile-social .douban:hover::before{color:#007711}.profile-social .facebook{top:2px}.profile-social .facebook::before{font-size:1.5rem;content:'\e67a'}.profile-social .facebook:hover::before{color:#3b5998}.profile-social .twitter::before{content:'\e634'}.profile-social .twitter:hover::before{color:#1da1f2}.profile-social .instagram{top:1px}.profile-social .instagram::before{content:'\e79d';font-size:1.4rem}.profile-social .instagram:hover::before{color:#8042b6}.profile-social .stack-overflow::before{font-size:1.15rem;content:'\e80b'}.profile-social .stack-overflow:hover::before{color:#f37f23}.profile-social .segmentFault{top:1.5px}.profile-social .segmentFault::before{font-size:1.5rem;content:'\e60c'}.profile-social .segmentFault:hover::before{color:#f37f23}.profile-social .juejin::before{font-size:1.35rem;content:'\e60b'}.profile-social .juejin:hover::before{color:#f37f23}.profile-social .v2ex::before{font-size:1.1rem;content:'\e663'}.profile-social .v2ex:hover::before{color:#171718}.profile-social .bilibili{top:2px}.profile-social .bilibili::before{font-size:1.75rem;content:'\e64e'}.profile-social .bilibili:hover::before{color:#2cb2f9}.profile-social .linkedin{top:-.5px}.profile-social .linkedin::before{font-size:1.25rem;content:'\e695'}.profile-social .linkedin:hover::before{color:#0077b5}.profile-social .steam{top:-.5px}.profile-social .steam::before{font-size:1.25rem;content:'\f23b'}.profile-social .steam:hover::before{color:#010101}.profile-social .others{top:-.5px}.profile-social .others::before{font-size:1.1rem;content:'\e64a'}.profile-social .others:hover::before{color:#8090b0}.profile-social .rss::before{font-size:1.05rem;content:'\e652'}.profile-social .rss:hover::before{color:#e53935}.wechat,.qq{cursor:pointer}.wechat:hover .profile-qr,.qq:hover .profile-qr{opacity:1;visibility:visible}.profile-qr{visibility:hidden;position:absolute;left:0;bottom:2.5rem;border:3px solid #fff;border-radius:3px;z-index:99;background-color:#fff;width:7rem;opacity:0;transition:all 0.1s ease-in 0s}.friends{padding:0.5rem 0;border-bottom:1px solid rgba(0,0,0,0.1);text-align:left}.friends div{font-size:1.2rem;text-align:left;font-weight:bold}.friends a{margin-right:0.6rem}.about-me{padding:0.5rem 0;border-bottom:1px solid rgba(0,0,0,0.1)}.about-me a{font-size:1.2rem;font-weight:bold}.footer{flex-grow:1;display:flex;flex-direction:column;justify-content:flex-end;padding:2.5rem 0 1.5rem 0;background-color:#fff}.social{text-align:center;vertical-align:text-bottom}.social .iconfont-archer{position:relative}.social .iconfont-archer{display:inline-block;text-align:center}.social .iconfont-archer::before{display:inline-block;color:#777;font-size:2.4rem;margin:0 .5rem 0 0}.social .iconfont-archer:last-of-child::before{margin:0}.social .email{top:2.4px}.social .email::before{content:'\e642'}.social .email:hover::before{color:#0cb49d}.social .github::before{font-size:2.56rem;content:'\e69f'}.social .github:hover::before{color:#24292e}.social .wechat{top:3.2px}.social .wechat::before{font-size:2.24rem;content:'\ec7d'}.social .wechat:hover::before{color:#42ae3c}.social .qq{top:3.2px}.social .qq::before{font-size:2.24rem;content:'\e61d'}.social .qq:hover::before{color:#4f4e71}.social .telegram{top:3.2px}.social .telegram::before{font-size:2.08rem;content:'\e731'}.social .telegram:hover::before{color:#36a1d3}.social .weibo::before{font-size:2.56rem;content:'\e619'}.social .weibo:hover::before{color:#d52a2a}.social .zhihu{top:2.4px}.social .zhihu::before{font-size:2.16rem;content:'\e61a'}.social .zhihu:hover::before{color:#0f88eb}.social .douban{top:1.6px}.social .douban::before{font-size:2rem;content:'\e605'}.social .douban:hover::before{color:#007711}.social .facebook{top:3.2px}.social .facebook::before{font-size:2.4rem;content:'\e67a'}.social .facebook:hover::before{color:#3b5998}.social .twitter::before{content:'\e634'}.social .twitter:hover::before{color:#1da1f2}.social .instagram{top:1.6px}.social .instagram::before{content:'\e79d';font-size:2.24rem}.social .instagram:hover::before{color:#8042b6}.social .stack-overflow::before{font-size:1.84rem;content:'\e80b'}.social .stack-overflow:hover::before{color:#f37f23}.social .segmentFault{top:2.4px}.social .segmentFault::before{font-size:2.4rem;content:'\e60c'}.social .segmentFault:hover::before{color:#f37f23}.social .juejin::before{font-size:2.16rem;content:'\e60b'}.social .juejin:hover::before{color:#f37f23}.social .v2ex::before{font-size:1.76rem;content:'\e663'}.social .v2ex:hover::before{color:#171718}.social .bilibili{top:3.2px}.social .bilibili::before{font-size:2.8rem;content:'\e64e'}.social .bilibili:hover::before{color:#2cb2f9}.social .linkedin{top:-.8px}.social .linkedin::before{font-size:2rem;content:'\e695'}.social .linkedin:hover::before{color:#0077b5}.social .steam{top:-.8px}.social .steam::before{font-size:2rem;content:'\f23b'}.social .steam:hover::before{color:#010101}.social .others{top:-.8px}.social .others::before{font-size:1.76rem;content:'\e64a'}.social .others:hover::before{color:#8090b0}.social .rss::before{font-size:1.68rem;content:'\e652'}.social .rss:hover::before{color:#e53935}.copyright{font-family:"Oswald-Regular";margin:0.5rem auto;text-align:center;color:#777}.copyright a{color:#f75357}.power{position:relative;vertical-align:baseline;font-size:1rem;padding:0 0.2rem}.busuanzi-container{text-align:center}#busuanzi_container_site_pv,#busuanzi_container_site_uv{display:block;text-align:center;font:0.6rem "Oswald-Regular";color:#ddd}.page-nav{padding:1rem 0 0.5rem 0;display:flex;justify-content:center}.page-nav>*{font:1.4rem "Oswald-Regular";color:#252525;vertical-align:middle;margin-right:0.5rem;text-align:center}.page-nav a{position:relative;color:#ccc;overflow:visible}.page-nav a::after{content:'';position:absolute;left:calc((100% - 98%) / 2);bottom:-15%;transition:all 0.15s ease-in;width:98%;height:2px;transform:translate(0, 0);background-color:#ccc;opacity:0}.page-nav a:hover::after{transform:translate(0, -2px);opacity:1}@font-face{font-family:'iconfont-archer';src:url("//at.alicdn.com/t/font_327081_s1wbjxwfu9c.eot");src:url("//at.alicdn.com/t/font_327081_s1wbjxwfu9c.eot?#iefix") format("embedded-opentype"),url("//at.alicdn.com/t/font_327081_s1wbjxwfu9c.woff") format("woff"),url("//at.alicdn.com/t/font_327081_s1wbjxwfu9c.ttf") format("truetype"),url("//at.alicdn.com/t/font_327081_s1wbjxwfu9c.svg#iconfont-archer") format("svg")}.iconfont-archer{font-family:'iconfont-archer' !important;font-size:1rem;font-style:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.popup{display:none;position:fixed;top:10%;left:50%;width:700px;height:80%;margin-left:-350px;padding:3px 0 0 10px;background:#fff;color:#333;z-index:9999;box-shadow:0px 0px 10px rgba(0,0,0,0.5);border-radius:5px}@media (max-width: 767px){.popup{padding:3px;top:0;left:0;margin:0;width:100%;height:100%;border-radius:0px}}.popoverlay{position:fixed;width:100%;height:100%;top:0px;left:0px;z-index:2080;background-color:rgba(0,0,0,0.3)}.popup-btn-close{position:absolute;top:6px;right:14px;color:#f75357;cursor:pointer}.popup-btn-close .iconfont-archer{font-size:20px}.algolia-popup{overflow:hidden;padding:0}.algolia-popup .popup-btn-close{padding-left:15px;border-left:1px solid #ddd;top:10px}.algolia-popup .popup-btn-close .fa{color:#999;font-size:18px}.algolia-popup .popup-btn-close:hover .fa{color:#222}.algolia-search{padding:10px 15px 5px;max-height:50px;border-bottom:1px solid #ccc;background:#f5f5f5;border-top-left-radius:5px;border-top-right-radius:5px}.algolia-search-input-icon{display:inline-block;width:20px}.algolia-search-input-icon .fa{font-size:18px}.algolia-search-input{display:inline-block;width:calc(90% - 20px)}.algolia-search-input input{padding:5px 0;width:100%;outline:none;border:none;background:transparent}.algolia-powered{float:right}.algolia-powered img{display:inline-block;height:18px;vertical-align:middle}.algolia-results{position:relative;overflow:auto;padding:10px 0px;height:calc(100% - 50px)}.algolia-results hr{margin:10px 0}.algolia-results .highlight{font-style:normal;margin:0;padding:0 2px;font-size:inherit;color:#f00}.algolia-stat-root{font-weight:lighter;color:#aaa;padding-left:20px;padding-right:20px}.algolia-hits{margin-top:20px}.algolia-hit-list{padding-left:0}.algolia-hit-empty{display:flex;flex-direction:column;align-items:center;margin-top:4em}.algolia-hit-empty-label{margin-top:1em}.algolia-hit-item{margin:0;--border-opacity: 1;padding:10px 20px;border-bottom:1px dashed;border-color:rgba(245, 245, 250, var(--border-opacity));cursor:pointer}.algolia-hit-item:hover{background:#eee;border-color:transparent}.algolia-hit-item-link{color:#555;padding:0 0 2px 0;display:block;transition-duration:0.2s;transition-timing-function:ease-in-out;transition-delay:0s}.algolia-hit-item-link em{font-style:normal;color:#f75357}.ais-Pagination-list{display:flex;justify-content:center;padding:0;margin:40px 0 0 0;border-top:none}.ais-Pagination-item{display:inline-block;margin:0 5px}.ais-Pagination-item a{color:#f75357}.ais-Pagination-item--active a{pointer-events:none;cursor:auto;color:#222}.ais-Pagination-item--page{border-top:none}.ais-Pagination-item--page:hover{border-bottom:1px solid #222}.algolia-pop-overlay{position:fixed;top:0;right:0;left:0;bottom:0;z-index:50}html::-webkit-scrollbar,.sidebar-panel-archives::-webkit-scrollbar,.sidebar-tags-list::-webkit-scrollbar,.sidebar-categories-list::-webkit-scrollbar,.highlight::-webkit-scrollbar{background-color:rgba(0,0,0,0.5);width:5px}html::-webkit-scrollbar-corner,.sidebar-panel-archives::-webkit-scrollbar-corner,.sidebar-tags-list::-webkit-scrollbar-corner,.sidebar-categories-list::-webkit-scrollbar-corner,.highlight::-webkit-scrollbar-corner{display:none}html::-webkit-scrollbar-button,.sidebar-panel-archives::-webkit-scrollbar-button,.sidebar-tags-list::-webkit-scrollbar-button,.sidebar-categories-list::-webkit-scrollbar-button,.highlight::-webkit-scrollbar-button{display:none}html::-webkit-scrollbar-button:start:increment,html::-webkit-scrollbar-button:end:decrement,.sidebar-panel-archives::-webkit-scrollbar-button:start:increment,.sidebar-panel-archives::-webkit-scrollbar-button:end:decrement,.sidebar-tags-list::-webkit-scrollbar-button:start:increment,.sidebar-tags-list::-webkit-scrollbar-button:end:decrement,.sidebar-categories-list::-webkit-scrollbar-button:start:increment,.sidebar-categories-list::-webkit-scrollbar-button:end:decrement,.highlight::-webkit-scrollbar-button:start:increment,.highlight::-webkit-scrollbar-button:end:decrement{display:none}html::-webkit-scrollbar-thumb,.sidebar-panel-archives::-webkit-scrollbar-thumb,.sidebar-tags-list::-webkit-scrollbar-thumb,.sidebar-categories-list::-webkit-scrollbar-thumb,.highlight::-webkit-scrollbar-thumb{border-radius:8px;background-color:rgba(0,0,0,0.2)}html::-webkit-scrollbar-track,html::-webkit-scrollbar-thumb,.sidebar-panel-archives::-webkit-scrollbar-track,.sidebar-panel-archives::-webkit-scrollbar-thumb,.sidebar-tags-list::-webkit-scrollbar-track,.sidebar-tags-list::-webkit-scrollbar-thumb,.sidebar-categories-list::-webkit-scrollbar-track,.sidebar-categories-list::-webkit-scrollbar-thumb,.highlight::-webkit-scrollbar-track,.highlight::-webkit-scrollbar-thumb{border:none}html::-webkit-scrollbar-thumb,.sidebar-panel-archives::-webkit-scrollbar-thumb,.sidebar-tags-list::-webkit-scrollbar-thumb,.sidebar-categories-list::-webkit-scrollbar-thumb,.highlight::-webkit-scrollbar-thumb{background-color:rgba(255,255,255,0.2);border-radius:0px}html::-webkit-scrollbar-track:hover,.sidebar-panel-archives::-webkit-scrollbar-track:hover,.sidebar-tags-list::-webkit-scrollbar-track:hover,.sidebar-categories-list::-webkit-scrollbar-track:hover,.highlight::-webkit-scrollbar-track:hover{background-color:rgba(0,0,0,0.1)}.sidebar-archive::-webkit-scrollbar-thumb,.sidebar-tags-list::-webkit-scrollbar-thumb,.sidebar-categories-list::-webkit-scrollbar-thumb{border-radius:8px;background-color:rgba(255,255,255,0.7)}.sidebar-archive::-webkit-scrollbar-thumb,.sidebar-tags-list::-webkit-scrollbar-thumb,.sidebar-categories-list::-webkit-scrollbar-thumb{background-color:rgba(255,255,255,0.7);border-radius:0px}.sidebar-archive::-webkit-scrollbar-track:hover,.sidebar-tags-list::-webkit-scrollbar-track:hover,.sidebar-categories-list::-webkit-scrollbar-track:hover{background-color:rgba(255,255,255,0.7)}.highlight::-webkit-scrollbar{height:5px}.highlight::-webkit-scrollbar-thumb{border-radius:8px;background-color:rgba(255,255,255,0.3)}.highlight::-webkit-scrollbar-thumb{background-color:rgba(255,255,255,0.3);border-radius:0px}.highlight::-webkit-scrollbar-track:hover{background-color:rgba(255,255,255,0.3)}@font-face{font-family:'iconfont-archer';src:url("//at.alicdn.com/t/font_327081_s1wbjxwfu9c.eot");src:url("//at.alicdn.com/t/font_327081_s1wbjxwfu9c.eot?#iefix") format("embedded-opentype"),url("//at.alicdn.com/t/font_327081_s1wbjxwfu9c.woff") format("woff"),url("//at.alicdn.com/t/font_327081_s1wbjxwfu9c.ttf") format("truetype"),url("//at.alicdn.com/t/font_327081_s1wbjxwfu9c.svg#iconfont-archer") format("svg")}.iconfont-archer{font-family:'iconfont-archer' !important;font-size:1rem;font-style:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.abstract-content pre,.abstract-content .highlight,.article-entry pre,.article-entry .highlight{margin:0.8rem 0;padding:0.7rem 0.7rem;overflow:auto;font-size:0.9rem;line-height:1.3rem}.abstract-content .highlight .gutter pre,.abstract-content .highlight .gutter pre .line,.abstract-content .gist .gist-file .gist-data .line-numbers,.article-entry .highlight .gutter pre,.article-entry .highlight .gutter pre .line,.article-entry .gist .gist-file .gist-data .line-numbers{color:#666}.abstract-content pre,.abstract-content code,.article-entry pre,.article-entry code{font-family:'Source Code Pro', Consolas, Menlo, Monaco, 'Courier New', monospace;font-weight:400}.abstract-content code,.article-entry code{background:#eee;padding:1px 0.4rem;border-radius:2px;margin:0 0.2rem;border:none}.abstract-content pre code,.article-entry pre code{background:none;text-shadow:none;padding:0;color:#657b83}.abstract-content .highlight,.article-entry .highlight{border-radius:4px}.abstract-content .highlight pre,.article-entry .highlight pre{border:none;margin:0;padding:0}.abstract-content .highlight table,.article-entry .highlight table{margin:0;width:auto}.abstract-content .highlight td,.article-entry .highlight td{border:none;padding:0}.abstract-content .highlight figcaption,.article-entry .highlight figcaption{color:highlight-comment;line-height:1em;margin-bottom:1em}.abstract-content .highlight figcaption:before,.abstract-content .highlight figcaption:after,.article-entry .highlight figcaption:before,.article-entry .highlight figcaption:after{content:'';display:table}.abstract-content .highlight figcaption:after,.article-entry .highlight figcaption:after{clear:both}.abstract-content .highlight figcaption a,.article-entry .highlight figcaption a{float:right}.abstract-content .highlight .gutter pre,.article-entry .highlight .gutter pre{text-align:right;padding-right:20px}.abstract-content .highlight .gutter pre .line,.article-entry .highlight .gutter pre .line{text-shadow:none}.abstract-content .highlight .line,.article-entry .highlight .line{min-height:19px}.abstract-content .highlight,.abstract-content pre,.article-entry .highlight,.article-entry pre{color:#abb2bf;background:#282c34}.abstract-content .highlight pre .comment,.abstract-content .highlight pre .quote,.article-entry .highlight pre .comment,.article-entry .highlight pre .quote{color:#5c6370;font-style:italic}.abstract-content .highlight pre .doctag,.abstract-content .highlight pre .keyword,.abstract-content .highlight pre .formula,.article-entry .highlight pre .doctag,.article-entry .highlight pre .keyword,.article-entry .highlight pre .formula{color:#c678dd}.abstract-content .highlight pre .section,.abstract-content .highlight pre .name,.abstract-content .highlight pre .selector-tag,.abstract-content .highlight pre .deletion,.abstract-content .highlight pre .subst,.article-entry .highlight pre .section,.article-entry .highlight pre .name,.article-entry .highlight pre .selector-tag,.article-entry .highlight pre .deletion,.article-entry .highlight pre .subst{color:#e06c75}.abstract-content .highlight pre .literal,.article-entry .highlight pre .literal{color:#56b6c2}.abstract-content .highlight pre .string,.abstract-content .highlight pre .regexp,.abstract-content .highlight pre .addition,.abstract-content .highlight pre .attribute,.abstract-content .highlight pre .meta-string,.article-entry .highlight pre .string,.article-entry .highlight pre .regexp,.article-entry .highlight pre .addition,.article-entry .highlight pre .attribute,.article-entry .highlight pre .meta-string{color:#98c379}.abstract-content .highlight pre .built_in,.abstract-content .highlight pre .class pre .title,.article-entry .highlight pre .built_in,.article-entry .highlight pre .class pre .title{color:#e6c07b}.abstract-content .highlight pre .attr,.abstract-content .highlight pre .variable,.abstract-content .highlight pre .template-variable,.abstract-content .highlight pre .type,.abstract-content .highlight pre .selector-class,.abstract-content .highlight pre .selector-attr,.abstract-content .highlight pre .selector-pseudo,.abstract-content .highlight pre .number,.article-entry .highlight pre .attr,.article-entry .highlight pre .variable,.article-entry .highlight pre .template-variable,.article-entry .highlight pre .type,.article-entry .highlight pre .selector-class,.article-entry .highlight pre .selector-attr,.article-entry .highlight pre .selector-pseudo,.article-entry .highlight pre .number{color:#d19a66}.abstract-content .highlight pre .symbol,.abstract-content .highlight pre .bullet,.abstract-content .highlight pre .link,.abstract-content .highlight pre .meta,.abstract-content .highlight pre .selector-id,.abstract-content .highlight pre .title,.article-entry .highlight pre .symbol,.article-entry .highlight pre .bullet,.article-entry .highlight pre .link,.article-entry .highlight pre .meta,.article-entry .highlight pre .selector-id,.article-entry .highlight pre .title{color:#61aeee}.abstract-content .highlight pre .emphasis,.article-entry .highlight pre .emphasis{font-style:italic}.abstract-content .highlight pre .strong,.article-entry .highlight pre .strong{font-weight:bold}.abstract-content .highlight pre .link,.article-entry .highlight pre .link{text-decoration:underline}.abstract-content .gist,.article-entry .gist{margin:0 -20px;border-style:solid;border-color:#ddd;border-width:1px 0;background:#272822;padding:15px 20px 15px 0}.abstract-content .gist .gist-file,.article-entry .gist .gist-file{border:none;font-family:'Source Code Pro', Consolas, Monaco, Menlo, Consolas, monospace;margin:0}.abstract-content .gist .gist-file .gist-data,.article-entry .gist .gist-file .gist-data{background:none;border:none}.abstract-content .gist .gist-file .gist-data .line-numbers,.article-entry .gist .gist-file .gist-data .line-numbers{background:none;border:none;padding:0 20px 0 0}.abstract-content .gist .gist-file .gist-data .line-data,.article-entry .gist .gist-file .gist-data .line-data{padding:0 !important}.abstract-content .gist .gist-file .highlight,.article-entry .gist .gist-file .highlight{margin:0;padding:0;border:none}.abstract-content .gist .gist-file .gist-meta,.article-entry .gist .gist-file .gist-meta{background:#272822;color:highlight-comment;font:0.85em 'Helvetica Neue', Helvetica, Arial, sans-serif;text-shadow:0 0;padding:0;margin-top:1em;margin-left:20px}.abstract-content .gist .gist-file .gist-meta a,.article-entry .gist .gist-file .gist-meta a{color:#258fb8;font-weight:normal}.abstract-content .gist .gist-file .gist-meta a:hover,.article-entry .gist .gist-file .gist-meta a:hover{text-decoration:underline}@font-face{font-family:'iconfont-archer';src:url("//at.alicdn.com/t/font_327081_s1wbjxwfu9c.eot");src:url("//at.alicdn.com/t/font_327081_s1wbjxwfu9c.eot?#iefix") format("embedded-opentype"),url("//at.alicdn.com/t/font_327081_s1wbjxwfu9c.woff") format("woff"),url("//at.alicdn.com/t/font_327081_s1wbjxwfu9c.ttf") format("truetype"),url("//at.alicdn.com/t/font_327081_s1wbjxwfu9c.svg#iconfont-archer") format("svg")}.iconfont-archer{font-family:'iconfont-archer' !important;font-size:1rem;font-style:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.sidebar-panel-archives{padding:1rem}.sidebar-panel-archives ul{padding:0;margin:0}.ps__rail-x,.ps__rail-y{display:none !important}.post-archive{overflow-y:auto}.archive-post-item,.meta-post-item{vertical-align:middle;border-left:1px solid #bbb;margin-left:0.3rem;padding:0.1rem 0 0.1rem 0.5rem;box-sizing:border-box}.archive-post-item:hover,.meta-post-item:hover{border-left-color:#f75357}.archive-post-item:hover .archive-post-date,.meta-post-item:hover .archive-post-date,.archive-post-item:hover .meta-post-date,.meta-post-item:hover .meta-post-date,.archive-post-item:hover .archive-post-title,.meta-post-item:hover .archive-post-title,.archive-post-item:hover .meta-post-title,.meta-post-item:hover .meta-post-title{color:#f75357}.total-and-search{display:flex}.site-search .search-icon{cursor:pointer;color:#f75357;line-height:1.9rem;font-size:1.5rem;position:relative;margin-left:0.5rem}.archive-year,.total-archive{font:1.2rem "Oswald-Regular";color:#f75357}.archive-year{font-size:1rem;margin-bottom:0.3rem}.archive-post-date,.meta-post-date{font:0.9rem/1rem "Oswald-Regular";color:#999}.archive-post-title,.meta-post-title{font-size:1rem;margin-left:0.8rem;text-align:left;color:#ccc}.sidebar-panel-tags,.sidebar-panel-categories{padding:1rem 1rem 5px 1rem;position:relative;display:flex;flex-direction:column}.sidebar-tags-name,.sidebar-categories-name{flex-grow:0;width:100%;padding:0 0 1rem 0;max-height:28rem;overflow:auto}.sidebar-tag-name,.sidebar-category-name{display:inline-block;border:1px solid #fff;border-radius:5rem;padding:0.07rem 0.4rem 0.1rem 0.4rem;margin:0.2rem 0;white-space:nowrap;font-size:1rem;cursor:pointer;color:#fff}.sidebar-tag-name:hover,.sidebar-category-name:hover{border-color:#f75357;color:#f75357}.sidebar-tag-name .iconfont-archer,.sidebar-category-name .iconfont-archer{pointer-events:none;transform:translateY(-1rem);font-size:0.6rem;margin:0 0.3rem 0 0.1rem}.sidebar-category-name .iconfont-archer{font-size:16px}.sidebar-tags-empty,.sidebar-categories-empty{display:none}.sidebar-tags-empty-active,.sidebar-categories-empty-active{display:block;font-size:6rem !important;margin-top:7rem;user-select:none;text-align:center;color:#fff}.sidebar-label-focus{border-color:#f75357;color:#f75357}.sidebar-tags-list,.sidebar-categories-list{flex-grow:1;padding:1rem 1rem 0 0;overflow-y:auto}.sidebar{position:fixed;display:flex;flex-direction:column;left:0;top:0;z-index:0;height:100%;width:400px;transition:all 0.3s ease-in 0s;overflow-x:hidden;background-color:#222}.sidebar-hide{display:none}.sidebar-tabs{display:flex;position:relative;padding:0;margin:0;height:4rem;width:100%;z-index:1001;justify-content:space-around;align-items:flex-start;font-family:"Oswald-Regular";flex-grow:0;color:#eee;border-bottom:2px solid #666}.sidebar-tabs::after{content:'';position:absolute;width:33.33%;height:2px;left:0;top:100%;background-color:#f75357;transform:translate3d(0, 0, 0);transition:transform 0.2s ease-out 0s}.sidebar-tab-archives,.sidebar-tab-tags,.sidebar-tab-categories{display:flex;align-items:center;justify-content:center;font-size:1.3rem;width:33.333%;height:100%;cursor:pointer}.sidebar-tab-archives .iconfont-archer,.sidebar-tab-tags .iconfont-archer,.sidebar-tab-categories .iconfont-archer{pointer-events:none;margin:0 0.5rem 0 0rem;font-size:1.5rem}.tab-name{pointer-events:none;font-size:1.5rem;margin-left:0.2rem}.sidebar-tabs-active-0::after{transform:translate3d(0, 0, 0)}.sidebar-tabs-active-1::after{transform:translate3d(100%, 0, 0)}.sidebar-tabs-active-2::after{transform:translate3d(200%, 0, 0)}.sidebar-content{position:relative;display:flex;width:300%;height:calc(100% - 4rem);top:0;left:0;transition:transform 0.3s ease-out 0s;overflow-x:hidden;transform:translate3d(0, 0, 0)}.sidebar-panel-archives,.sidebar-panel-tags,.sidebar-panel-categories{overflow-x:hidden;overflow-y:auto;flex-shrink:0;width:calc(33.33% - 2rem);-webkit-overflow-scrolling:touch;overflow-scrolling:touch}.sidebar-content-active-0{transform:translate3d(0, 0, 0)}.sidebar-content-active-1{transform:translate3d(-33.33%, 0, 0)}.sidebar-content-active-2{transform:translate3d(-66.67%, 0, 0)}.index-post{position:relative;padding:1rem 0rem 1rem 0rem;border-bottom:1px dashed rgba(0,0,0,0.2);z-index:3}.index-post .abstract-content{color:#585858;font-size:1rem;line-height:1.6rem;font-weight:300;word-break:break-word}.index-post .abstract-content img{max-width:100%;box-shadow:none}.abstract-title{line-height:2.5rem;color:#1f1f1f;padding-bottom:0.5rem}.abstract-title span:last-of-type{transition:color 0.1s ease-in;font-size:1.7rem}.abstract-title span:last-of-type:hover{color:#f75357}.stick-top{font-size:1.3rem;margin-right:0.2rem}.abstract-post-meta{display:flex;justify-content:space-between;padding:0.5rem 0 0 0;font-family:"Oswald-Regular";color:#aaa;height:1.5rem}.post-tag{font-size:1rem;position:relative;color:#aaa;margin-left:0.4rem;font-weight:lighter}.post-tag::before{margin-right:2px;content:'#'}.post-tag::after{content:'';position:absolute;left:calc((100% - 98%) / 2);bottom:-15%;transition:all 0.15s ease-in;width:98%;height:2px;transform:translate(0, 0);background-color:#aaa;opacity:0}.post-tag:hover::after{transform:translate(0, -2px);opacity:1}.abstract-calander{position:relative;top:-0.1rem;margin-right:0.3rem;font-size:1rem}@font-face{font-family:'iconfont-archer';src:url("//at.alicdn.com/t/font_327081_s1wbjxwfu9c.eot");src:url("//at.alicdn.com/t/font_327081_s1wbjxwfu9c.eot?#iefix") format("embedded-opentype"),url("//at.alicdn.com/t/font_327081_s1wbjxwfu9c.woff") format("woff"),url("//at.alicdn.com/t/font_327081_s1wbjxwfu9c.ttf") format("truetype"),url("//at.alicdn.com/t/font_327081_s1wbjxwfu9c.svg#iconfont-archer") format("svg")}.iconfont-archer{font-family:'iconfont-archer' !important;font-size:1rem;font-style:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.post-body main,.about-body main{margin:0}.anchorjs-archer{color:#f75357;border:none !important}.post-body .site-intro-meta,.about-body .site-intro-meta{width:50%;min-width:42.8125rem;margin:0 auto;align-items:flex-start}.post-body .intro-title,.about-body .intro-title{font:4rem/5.3rem "Oswald-Regular";color:#fff;margin:0}.post-intros{opacity:0;transition:all 0.5s ease-out 0.5s;transform:translate3d(0, -1rem, 0)}.post-intro-tags{font:1.2rem "Oswald-Regular"}.post-intro-tags .post-tag{position:relative;margin-left:0;margin-right:0.5rem;font-size:1.2rem;color:#fff}.post-intro-tags .post-tag::after{content:'';position:absolute;left:calc((100% - 98%) / 2);bottom:-15%;transition:all 0.15s ease-in;width:98%;height:2px;transform:translate(0, 0);background-color:#fff;opacity:0}.post-intro-tags .post-tag:hover::after{transform:translate(0, -2px);opacity:1}.post-intro-tags .post-tag::before{content:'#'}.post-intro-meta{margin-top:0.2rem;font:1.1rem "Oswald-Regular";color:#fff;display:flex;align-items:center}.post-intro-read{margin-top:0.2rem;font:0.9rem "Oswald-Regular";color:#fff;display:flex;align-items:center}.word-count{margin-right:1rem}.post-fade-in{opacity:1;transform:translate3d(0, 0, 0)}.post-intro-calander{font-size:0.9rem;margin-right:0.3rem}.post-intro-time{font-size:0.9rem;margin-right:0.5rem}.busuanzi-pv,.busuanzi-uv{font-size:0.9rem;margin-right:0.4rem}.shareWrapper{position:relative;font-size:0.9rem;padding:0 0.5rem 0 0}.shareWrapper:hover .shareList{visibility:visible;opacity:1}.shareIcon{font-size:0.9rem;cursor:pointer}.shareText{font-family:"Oswald-Regular";cursor:pointer}.shareList{position:absolute;visibility:hidden;margin:0;padding:0;left:100%;bottom:0;display:flex;opacity:0;transition:all 0.1s ease-in 0s}.shareList .iconfont-archer{display:inline-block;margin-right:3px;cursor:pointer}.shareList .iconfont-archer:hover{color:#aaa}.shareList [data-type='weibo']{position:relative;top:-2px}.shareList [data-type='facebook']{position:relative;top:1px}.share-qr{position:relative}.share-qrcode{position:absolute;left:0;bottom:1.5rem;visibility:hidden;opacity:0;transition:all 0.1s ease-in 0s}.share-qr:hover .share-qrcode{visibility:visible;opacity:1}.post-paginator{overflow:hidden;margin:0;list-style:none;padding:2.5rem 0 1rem 0;display:flex;justify-content:space-between}.post-paginator li{position:relative;max-width:13rem}.post-paginator .nextTitle,.post-paginator .prevTitle{font-size:1.2rem;color:#ccc}.post-paginator .nextTitle:hover,.post-paginator .prevTitle:hover{color:#f75357}.post-paginator .nextSlogan,.post-paginator .prevSlogan{font:bold 1.4rem "Oswald-Regular";color:#252525}.post-paginator .nextSlogan::before{content:'< ';font-size:1.7rem}.post-paginator .prevSlogan::after{content:' >';font-size:1.7rem}.abstract-content,.article-entry{position:relative;padding:1px 0;font-weight:lighter;font-weight:400;color:#23394d}.abstract-content ul,.abstract-content ul li,.article-entry ul,.article-entry ul li{list-style-type:initial}.abstract-content ol,.abstract-content ol li,.article-entry ol,.article-entry ol li{list-style-type:decimal-leading-zero}.abstract-content h1:first-child,.article-entry h1:first-child{margin-top:0}.abstract-content h2:first-child,.article-entry h2:first-child{margin-top:0}.abstract-content h3:first-child,.article-entry h3:first-child{margin-top:0}.abstract-content h4:first-child,.article-entry h4:first-child{margin-top:0}.abstract-content h5:first-child,.article-entry h5:first-child{margin-top:0}.abstract-content h6:first-child,.article-entry h6:first-child{margin-top:0}.abstract-content h5,.article-entry h5{font-size:1rem;margin:1rem 0}.abstract-content h6,.article-entry h6{font-size:0.8rem;margin:1rem 0}.abstract-content p,.article-entry p{line-height:1.625}.abstract-content em,.article-entry em{font-style:italic}.abstract-content img,.article-entry img{display:block;max-width:100%;margin:1rem auto 1rem;box-shadow:0 0 4px 2px rgba(0,0,0,0.2)}.abstract-content blockquote,.article-entry blockquote{margin:1.5em 0 1.5rem 0;padding:10px 20px;position:relative;background-color:#f6f6f6;border-left:3px solid #f75357}.abstract-content blockquote p,.article-entry blockquote p{margin:0}.abstract-content .table-container table,.abstract-content>table,.article-entry .table-container table,.article-entry>table{width:100%;border:1px solid #ddd;margin:1rem 0;border-collapse:collapse;box-shadow:2px 2px 2px rgba(0,0,0,0.125)}.abstract-content .table-container table tr,.abstract-content .table-container table td,.abstract-content>table tr,.abstract-content>table td,.article-entry .table-container table tr,.article-entry .table-container table td,.article-entry>table tr,.article-entry>table td{height:2rem}.abstract-content .table-container table thead tr,.abstract-content>table thead tr,.article-entry .table-container table thead tr,.article-entry>table thead tr{background:#f8f8f8}.abstract-content .table-container table tbody tr:hover,.abstract-content>table tbody tr:hover,.article-entry .table-container table tbody tr:hover,.article-entry>table tbody tr:hover{background:#efefef}.abstract-content .table-container table td,.abstract-content .table-container table th,.abstract-content>table td,.abstract-content>table th,.article-entry .table-container table td,.article-entry .table-container table th,.article-entry>table td,.article-entry>table th{border:1px solid #dedede;padding:0.2rem 1rem 0 1rem}.abstract-content a,.article-entry a{color:#f75357;padding:0 0 0 2px;word-break:break-all}.abstract-content a:hover,.article-entry a:hover{border-bottom:1px solid #f75357}.abstract-content a.fancybox,.article-entry a.fancybox{border:0}.license-wrapper{font-weight:300;line-height:1.5rem;border-top:1px dashed #ccc;border-bottom:1px dashed #ccc;color:#23394d}.license-wrapper p{margin:0.2rem 0}.license-wrapper a{color:#f75357}.toc-wrapper{display:block;position:absolute;top:50vh;width:22%;right:1%;overflow:hidden;max-width:calc((100% - 42.8125rem - 4rem) / 2);z-index:9999;margin:calc(3.5rem + 1rem) 0 0 0;transform:translate3d(0, 0, 0);transition:transform 0.3s ease-out 0s}.toc-wrapper .toc-active{color:#f75357}.toc-catalog{color:#bbb;cursor:pointer;user-select:none;font:bolder 1.2rem "Oswald-Regular"}.toc-catalog:hover{color:#f75357}.catalog-icon{position:relative;top:-0.1rem;margin-right:0.3rem}.toc,.toc-child{padding-left:0;margin:0 0 0 0}.toc-wrapper>*{transform:translate(0, 0);transition:transform 0.3s ease-out, opacity 0.3s ease-out;opacity:1}.toc-wrapper ol{padding-left:1rem}.toc-wrapper .toc-number{font-weight:bold}.toc-wrapper a{color:#ddd}.toc-wrapper a:hover{color:#f75357 !important}.toc-hide-children>*{transform:translate(-100%, 0);opacity:0}.toc-hide-children .toc-catalog{display:block;transform:none;opacity:1}.toc-fixed{position:fixed;top:0rem !important}.toc-slide{transform:translate3d(400px, 0, 0)}.toc-hide{display:none}.four-zero-four-body .loading{display:none !important}.four-zero-four-body .site-intro{height:100%}.four-zero-four-body .site-intro-meta{height:80%}.four-zero-four-body .wrapper{height:100vh;padding-bottom:0}.four-zero-four-body .container{padding:0}.four-zero-four-body .footer{width:100%;z-index:30;background-color:transparent;position:absolute;bottom:0}.four-zero-four-body .iconfont-archer::before{color:rgba(255,255,255,0.5)}.four-zero-four-body .copyright{color:#fff} +@font-face{font-family:'iconfont-archer';src:url("//at.alicdn.com/t/font_327081_s1wbjxwfu9c.eot");src:url("//at.alicdn.com/t/font_327081_s1wbjxwfu9c.eot?#iefix") format("embedded-opentype"),url("//at.alicdn.com/t/font_327081_s1wbjxwfu9c.woff") format("woff"),url("//at.alicdn.com/t/font_327081_s1wbjxwfu9c.ttf") format("truetype"),url("//at.alicdn.com/t/font_327081_s1wbjxwfu9c.svg#iconfont-archer") format("svg")}.iconfont-archer{font-family:'iconfont-archer' !important;font-size:1rem;font-style:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}/*! normalize.css v3.0.2 | MIT License | git.io/normalize */html{-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:bold}dfn{font-style:italic}h1{font-size:2em;margin:0.67em 0}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace, monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type='checkbox'],input[type='radio']{box-sizing:border-box;padding:0}input[type='number']::-webkit-inner-spin-button,input[type='number']::-webkit-outer-spin-button{height:auto}input[type='searcher']{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}input[type='searcher']::-webkit-searcher-cancel-button,input[type='searcher']::-webkit-searcher-decoration{-webkit-appearance:none}fieldset{border:1px solid #c0c0c0;margin:0 2px;padding:0.35em 0.625em 0.75em}legend{border:0;padding:0}textarea{overflow:auto}optgroup{font-weight:bold}table{border-collapse:collapse;border-spacing:0}td,th{padding:0}html{font-size:16px;font-family:-apple-system,BlinkMacSystemFont,"Helvetica Neue",Arial,"PingFang SC","Hiragino Sans GB",STHeiti,"Microsoft YaHei","Microsoft JhengHei","Source Han Sans SC","Noto Sans CJK SC","Source Han Sans CN","Noto Sans SC","Source Han Sans TC","Noto Sans CJK TC","WenQuanYi Micro Hei",SimSun,sans-serif;overflow-x:hidden}*{font-family:inherit}body{z-index:100;position:relative;background-color:#fff;overflow-x:hidden}.wrapper{z-index:1;display:flex;flex-direction:column;width:100%;min-height:100vh;transition:all 0.3s ease-in 0s;transform:translate3d(0, 0, 0);position:relative;box-shadow:-3px 0 2px 0 rgba(0,0,0,0.6)}.wrapper-sidebar-active{transform:translate3d(400px, 0, 0)}.main{order:1;width:50%;min-width:42.8125rem;flex-grow:0;padding:0 0 0 0;margin-left:3rem}.container{display:flex;padding:3rem 0 0 0;position:relative;background-color:#fff;top:0;left:0;align-items:flex-start;justify-content:center;width:100%;overflow:hidden;transition:all 0.5s ease-out 0s;opacity:1;transform:translate3d(0, 0, 0)}.container-unloaded{opacity:0;transform:translate3d(0, 1rem, 0)}a{text-decoration:none}ul,li{list-style-type:none}.back-top{position:fixed;display:block;left:1rem;bottom:1rem;z-index:10;opacity:0;width:1.5rem;height:1.5rem;text-align:center;line-height:1.5rem;border:2px solid #000;background-color:rgba(255,255,255,0.8);cursor:pointer}.back-top:hover{background-color:#000;color:#fff}.back-top-show{opacity:1;pointer-events:initial}::selection{background:#f75357;color:#eee}::-moz-selection{background:#f75357;color:#eee}::-webkit-selection{background:#f75357;color:#eee}.fancy-link{padding:0 !important;margin:0 !important}.note{padding:0.75rem;border-left:0.35rem solid;border-radius:0.35rem;margin:1.5rem 0}.note-warning{background-color:#fdf8ea;border-color:#f0ad4e}.note-warning .title{font-size:medium;font-weight:500}@media (prefers-color-scheme: dark){body{background-color:#121212}.container{background-color:#121212}.profile-name{color:#ddd !important}.wrapper{box-shadow:-3px 0 2px 0 rgba(255,255,255,0.6) !important}.back-top{border:2px solid #fff !important;background-color:rgba(18,18,18,0.8) !important;color:#fff !important}.back-top:hover{background-color:#fff !important;color:#121212 !important}.note-warning{background-color:#222 !important}.abstract-title{color:#ccc !important}.abstract-content,.article-entry{color:#dfcbb9 !important}.abstract-content code,.article-entry code{background:#444 !important}.abstract-content blockquote,.article-entry blockquote{background-color:#464646 !important}.license-wrapper{color:#dfcbb9 !important}.header-sidebar-menu-black{color:#fff !important;background-color:#121212 !important;border-color:#fff !important}.header-sidebar-menu-black:hover{background-color:#fff !important;color:#121212 !important}.toc-wrapper .toc-active{color:#f75357 !important}.toc-wrapper a{color:#777 !important}.toc-wrapper a:hover{color:#f75357 !important}.footer{background-color:#121212 !important}.banner{border-bottom:1px solid rgba(255,255,255,0.8) !important;background-color:rgba(0,0,0,0.8) !important}.blog-title a{color:#fff !important}.blog-title a:hover{color:#f75357 !important}.post-title a{color:rgba(255,255,255,0.8) !important}.nextSlogan,.prevSlogan{color:#ddd !important}.popup{background:#121212 !important;color:#e1e1e1 !important;box-shadow:0px 0px 10px rgba(255,255,255,0.5) !important}.algolia-search{border-bottom:1px solid #222 !important;background:#121212 !important}}.site-intro-img{position:absolute;z-index:-1;top:0;left:0;height:calc(100% + 1px);width:100%;filter:brightness(0.5);-webkit-filter:brightness(0.5);-moz-filter:brightness(0.5);background-repeat:no-repeat;background-position:center center;background-size:cover;background-color:transparent}.site-intro-meta{width:100%;height:100%;display:flex;flex-direction:column;justify-content:center;align-items:center}.intro-title,.intro-subtitle{font-family:"Oswald-Regular";color:#fff;margin:0;opacity:0;transition:all 0.5s ease-out 0s;transform:translate(0, -1rem)}.intro-title{font-size:4rem}.intro-subtitle{font-size:2rem;transition-delay:0.5s}.intro-fade-in{opacity:1;transform:translate(0, 0)}.header{position:fixed;top:0;width:100%;height:3.5rem;overflow:hidden;z-index:10;transform:translate3d(0, 0, 0);transition:transform 0.3s ease-in 0s}.header-sidebar-active{transform:translate3d(400px, 0, 0)}.read-progress{width:100%;position:absolute;top:0;left:0;height:3px;background-color:rgba(0,0,0,0.7);transition:transform 0.1s ease-out 0s;transform:translate3d(-100%, 0, 0);z-index:99999}.banner{position:relative;width:100%;margin:0 auto;height:calc(100% - 1px);border-bottom:1px solid rgba(0,0,0,0.8);background-color:rgba(255,255,255,0.8);transform:translate3d(0, -100%, 0);transition:transform 0.3s ease-out 0s}.banner-show{transform:translate3d(0, 0, 0)}.post-title{display:flex;justify-content:center;align-items:center;height:100%;width:70%;margin-left:15%}.post-title a{white-space:nowrap;color:rgba(0,0,0,0.8);line-height:100%;max-width:100%;text-overflow:ellipsis;overflow:hidden;padding-bottom:0.2rem;text-align:center;font-size:1.5rem}.blog-title{display:flex;position:absolute;right:2.5rem;top:50%;transform:translate(0, -50%);justify-content:center;align-items:center;height:100%}.blog-title a{vertical-align:top;white-space:nowrap;color:#000;font:1rem/1rem "Oswald-Regular"}.blog-title a:hover{color:#f75357}.header-sidebar-menu{position:absolute;left:1rem;top:50%;border:2px solid #fff;width:1.5rem;height:1.5rem;transform:translate(0, -50%);transition:transform 0.3s ease;font-family:'iconfont-archer';color:#fff;text-align:center;line-height:1.5rem;z-index:21;cursor:pointer}.header-sidebar-menu:hover{background-color:#fff;color:#000;transform:translate(0, -50%)}.header-sidebar-menu-active{transform:translate(0, -50%) rotate(180deg) !important;transition:transform 0.3s ease}.header-sidebar-menu-black{color:#000;background-color:#fff;border-color:#000}.header-sidebar-menu-black:hover{background-color:#000;color:#fff}.home-link{position:absolute;right:2.5rem;top:50%;transform:translate(0, -50%);font-family:"Oswald-Regular";color:#fff;cursor:pointer}.home-link:hover{color:#f75357}.home-link-hide{display:none}.profile{order:0;vertical-align:top;flex-shrink:0;margin:4px 0 0 0;width:200px;font:1rem "Oswald-Regular";border-bottom:1px solid rgba(0,0,0,0.1);padding-bottom:0.5rem}.profile *{color:#777}.profile>*:last-child{border-bottom:none;padding-bottom:0}.profile-avatar{display:block;border-radius:1rem;width:100%;box-shadow:0 0 2px 0 rgba(0,0,0,0.6)}.profile-name{font-size:2rem;line-height:3rem;padding:0.5rem 0 0 0;color:#333;text-align:center}.profile-signature{font-size:1rem;text-align:center}.profile-social{position:relative;width:100%;text-align:left;line-height:1.7rem;padding:0.5rem 0;border-bottom:1px solid rgba(0,0,0,0.1)}.profile-social .iconfont-archer{position:relative}.profile-social .iconfont-archer{display:inline-block;text-align:center}.profile-social .iconfont-archer::before{display:inline-block;color:#777;font-size:1.5rem;margin:0 .4rem 0 0}.profile-social .iconfont-archer:last-of-child::before{margin:0}.profile-social .email{top:1.5px}.profile-social .email::before{content:'\e642'}.profile-social .email:hover::before{color:#0cb49d}.profile-social .github::before{font-size:1.6rem;content:'\e69f'}.profile-social .github:hover::before{color:#24292e}.profile-social .wechat{top:2px}.profile-social .wechat::before{font-size:1.4rem;content:'\ec7d'}.profile-social .wechat:hover::before{color:#42ae3c}.profile-social .qq{top:2px}.profile-social .qq::before{font-size:1.4rem;content:'\e61d'}.profile-social .qq:hover::before{color:#4f4e71}.profile-social .telegram{top:2px}.profile-social .telegram::before{font-size:1.3rem;content:'\e731'}.profile-social .telegram:hover::before{color:#36a1d3}.profile-social .weibo::before{font-size:1.6rem;content:'\e619'}.profile-social .weibo:hover::before{color:#d52a2a}.profile-social .zhihu{top:1.5px}.profile-social .zhihu::before{font-size:1.35rem;content:'\e61a'}.profile-social .zhihu:hover::before{color:#0f88eb}.profile-social .douban{top:1px}.profile-social .douban::before{font-size:1.25rem;content:'\e605'}.profile-social .douban:hover::before{color:#007711}.profile-social .facebook{top:2px}.profile-social .facebook::before{font-size:1.5rem;content:'\e67a'}.profile-social .facebook:hover::before{color:#3b5998}.profile-social .twitter::before{content:'\e634'}.profile-social .twitter:hover::before{color:#1da1f2}.profile-social .instagram{top:1px}.profile-social .instagram::before{content:'\e79d';font-size:1.4rem}.profile-social .instagram:hover::before{color:#8042b6}.profile-social .stack-overflow::before{font-size:1.15rem;content:'\e80b'}.profile-social .stack-overflow:hover::before{color:#f37f23}.profile-social .segmentFault{top:1.5px}.profile-social .segmentFault::before{font-size:1.5rem;content:'\e60c'}.profile-social .segmentFault:hover::before{color:#f37f23}.profile-social .juejin::before{font-size:1.35rem;content:'\e60b'}.profile-social .juejin:hover::before{color:#f37f23}.profile-social .v2ex::before{font-size:1.1rem;content:'\e663'}.profile-social .v2ex:hover::before{color:#171718}.profile-social .bilibili{top:2px}.profile-social .bilibili::before{font-size:1.75rem;content:'\e64e'}.profile-social .bilibili:hover::before{color:#2cb2f9}.profile-social .linkedin{top:-.5px}.profile-social .linkedin::before{font-size:1.25rem;content:'\e695'}.profile-social .linkedin:hover::before{color:#0077b5}.profile-social .steam{top:-.5px}.profile-social .steam::before{font-size:1.25rem;content:'\f23b'}.profile-social .steam:hover::before{color:#010101}.profile-social .others{top:-.5px}.profile-social .others::before{font-size:1.1rem;content:'\e64a'}.profile-social .others:hover::before{color:#8090b0}.profile-social .rss::before{font-size:1.05rem;content:'\e652'}.profile-social .rss:hover::before{color:#e53935}.wechat,.qq{cursor:pointer}.wechat:hover .profile-qr,.qq:hover .profile-qr{opacity:1;visibility:visible}.profile-qr{visibility:hidden;position:absolute;left:0;bottom:2.5rem;border:3px solid #fff;border-radius:3px;z-index:99;background-color:#fff;width:7rem;opacity:0;transition:all 0.1s ease-in 0s}.friends{padding:0.5rem 0;border-bottom:1px solid rgba(0,0,0,0.1);text-align:left}.friends div{font-size:1.2rem;text-align:left;font-weight:bold}.friends a{margin-right:0.6rem}.about-me{padding:0.5rem 0;border-bottom:1px solid rgba(0,0,0,0.1)}.about-me a{font-size:1.2rem;font-weight:bold}.footer{flex-grow:1;display:flex;flex-direction:column;justify-content:flex-end;padding:2.5rem 0 1.5rem 0;background-color:#fff}.social{text-align:center;vertical-align:text-bottom}.social .iconfont-archer{position:relative}.social .iconfont-archer{display:inline-block;text-align:center}.social .iconfont-archer::before{display:inline-block;color:#777;font-size:2.4rem;margin:0 .5rem 0 0}.social .iconfont-archer:last-of-child::before{margin:0}.social .email{top:2.4px}.social .email::before{content:'\e642'}.social .email:hover::before{color:#0cb49d}.social .github::before{font-size:2.56rem;content:'\e69f'}.social .github:hover::before{color:#24292e}.social .wechat{top:3.2px}.social .wechat::before{font-size:2.24rem;content:'\ec7d'}.social .wechat:hover::before{color:#42ae3c}.social .qq{top:3.2px}.social .qq::before{font-size:2.24rem;content:'\e61d'}.social .qq:hover::before{color:#4f4e71}.social .telegram{top:3.2px}.social .telegram::before{font-size:2.08rem;content:'\e731'}.social .telegram:hover::before{color:#36a1d3}.social .weibo::before{font-size:2.56rem;content:'\e619'}.social .weibo:hover::before{color:#d52a2a}.social .zhihu{top:2.4px}.social .zhihu::before{font-size:2.16rem;content:'\e61a'}.social .zhihu:hover::before{color:#0f88eb}.social .douban{top:1.6px}.social .douban::before{font-size:2rem;content:'\e605'}.social .douban:hover::before{color:#007711}.social .facebook{top:3.2px}.social .facebook::before{font-size:2.4rem;content:'\e67a'}.social .facebook:hover::before{color:#3b5998}.social .twitter::before{content:'\e634'}.social .twitter:hover::before{color:#1da1f2}.social .instagram{top:1.6px}.social .instagram::before{content:'\e79d';font-size:2.24rem}.social .instagram:hover::before{color:#8042b6}.social .stack-overflow::before{font-size:1.84rem;content:'\e80b'}.social .stack-overflow:hover::before{color:#f37f23}.social .segmentFault{top:2.4px}.social .segmentFault::before{font-size:2.4rem;content:'\e60c'}.social .segmentFault:hover::before{color:#f37f23}.social .juejin::before{font-size:2.16rem;content:'\e60b'}.social .juejin:hover::before{color:#f37f23}.social .v2ex::before{font-size:1.76rem;content:'\e663'}.social .v2ex:hover::before{color:#171718}.social .bilibili{top:3.2px}.social .bilibili::before{font-size:2.8rem;content:'\e64e'}.social .bilibili:hover::before{color:#2cb2f9}.social .linkedin{top:-.8px}.social .linkedin::before{font-size:2rem;content:'\e695'}.social .linkedin:hover::before{color:#0077b5}.social .steam{top:-.8px}.social .steam::before{font-size:2rem;content:'\f23b'}.social .steam:hover::before{color:#010101}.social .others{top:-.8px}.social .others::before{font-size:1.76rem;content:'\e64a'}.social .others:hover::before{color:#8090b0}.social .rss::before{font-size:1.68rem;content:'\e652'}.social .rss:hover::before{color:#e53935}.copyright{font-family:"Oswald-Regular";margin:0.5rem auto;text-align:center;color:#777}.copyright a{color:#f75357}.power{position:relative;vertical-align:baseline;font-size:1rem;padding:0 0.2rem}.busuanzi-container{text-align:center}#busuanzi_container_site_pv,#busuanzi_container_site_uv{display:block;text-align:center;font:0.6rem "Oswald-Regular";color:#ddd}.page-nav{padding:1rem 0 0.5rem 0;display:flex;justify-content:center}.page-nav>*{font:1.4rem "Oswald-Regular";color:#252525;vertical-align:middle;margin-right:0.5rem;text-align:center}.page-nav a{position:relative;color:#ccc;overflow:visible}.page-nav a::after{content:'';position:absolute;left:calc((100% - 98%) / 2);bottom:-15%;transition:all 0.15s ease-in;width:98%;height:2px;transform:translate(0, 0);background-color:#ccc;opacity:0}.page-nav a:hover::after{transform:translate(0, -2px);opacity:1}@font-face{font-family:'iconfont-archer';src:url("//at.alicdn.com/t/font_327081_s1wbjxwfu9c.eot");src:url("//at.alicdn.com/t/font_327081_s1wbjxwfu9c.eot?#iefix") format("embedded-opentype"),url("//at.alicdn.com/t/font_327081_s1wbjxwfu9c.woff") format("woff"),url("//at.alicdn.com/t/font_327081_s1wbjxwfu9c.ttf") format("truetype"),url("//at.alicdn.com/t/font_327081_s1wbjxwfu9c.svg#iconfont-archer") format("svg")}.iconfont-archer{font-family:'iconfont-archer' !important;font-size:1rem;font-style:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.popup{display:none;position:fixed;top:10%;left:50%;width:700px;height:80%;margin-left:-350px;padding:3px 0 0 10px;background:#fff;color:#333;z-index:9999;box-shadow:0px 0px 10px rgba(0,0,0,0.5);border-radius:5px}@media (max-width: 767px){.popup{padding:3px;top:0;left:0;margin:0;width:100%;height:100%;border-radius:0px}}.popoverlay{position:fixed;width:100%;height:100%;top:0px;left:0px;z-index:2080;background-color:rgba(0,0,0,0.3)}.popup-btn-close{position:absolute;top:6px;right:14px;color:#f75357;cursor:pointer}.popup-btn-close .iconfont-archer{font-size:20px}.algolia-popup{overflow:hidden;padding:0}.algolia-popup .popup-btn-close{padding-left:15px;border-left:1px solid #ddd;top:10px}.algolia-popup .popup-btn-close .fa{color:#999;font-size:18px}.algolia-popup .popup-btn-close:hover .fa{color:#222}.algolia-search{padding:10px 15px 5px;max-height:50px;border-bottom:1px solid #ccc;background:#f5f5f5;border-top-left-radius:5px;border-top-right-radius:5px}.algolia-search-input-icon{display:inline-block;width:20px}.algolia-search-input-icon .fa{font-size:18px}.algolia-search-input{display:inline-block;width:calc(90% - 20px)}.algolia-search-input input{padding:5px 0;width:100%;outline:none;border:none;background:transparent}.algolia-powered{float:right}.algolia-powered img{display:inline-block;height:18px;vertical-align:middle}.algolia-results{position:relative;overflow:auto;padding:10px 0px;height:calc(100% - 50px)}.algolia-results hr{margin:10px 0}.algolia-results .highlight{font-style:normal;margin:0;padding:0 2px;font-size:inherit;color:#f00}.algolia-stat-root{font-weight:lighter;color:#aaa;padding-left:20px;padding-right:20px}.algolia-hits{margin-top:20px}.algolia-hit-list{padding-left:0}.algolia-hit-empty{display:flex;flex-direction:column;align-items:center;margin-top:4em}.algolia-hit-empty-label{margin-top:1em}.algolia-hit-item{margin:0;--border-opacity: 1;padding:10px 20px;border-bottom:1px dashed;border-color:rgba(245, 245, 250, var(--border-opacity));cursor:pointer}.algolia-hit-item:hover{background:#eee;border-color:transparent}.algolia-hit-item-link{color:#555;padding:0 0 2px 0;display:block;transition-duration:0.2s;transition-timing-function:ease-in-out;transition-delay:0s}.algolia-hit-item-link em{font-style:normal;color:#f75357}.ais-Pagination-list{display:flex;justify-content:center;padding:0;margin:40px 0 0 0;border-top:none}.ais-Pagination-item{display:inline-block;margin:0 5px}.ais-Pagination-item a{color:#f75357}.ais-Pagination-item--active a{pointer-events:none;cursor:auto;color:#222}.ais-Pagination-item--page{border-top:none}.ais-Pagination-item--page:hover{border-bottom:1px solid #222}.algolia-pop-overlay{position:fixed;top:0;right:0;left:0;bottom:0;z-index:50}html::-webkit-scrollbar,.sidebar-panel-archives::-webkit-scrollbar,.sidebar-tags-list::-webkit-scrollbar,.sidebar-categories-list::-webkit-scrollbar,.highlight::-webkit-scrollbar{background-color:rgba(0,0,0,0.5);width:5px}html::-webkit-scrollbar-corner,.sidebar-panel-archives::-webkit-scrollbar-corner,.sidebar-tags-list::-webkit-scrollbar-corner,.sidebar-categories-list::-webkit-scrollbar-corner,.highlight::-webkit-scrollbar-corner{display:none}html::-webkit-scrollbar-button,.sidebar-panel-archives::-webkit-scrollbar-button,.sidebar-tags-list::-webkit-scrollbar-button,.sidebar-categories-list::-webkit-scrollbar-button,.highlight::-webkit-scrollbar-button{display:none}html::-webkit-scrollbar-button:start:increment,html::-webkit-scrollbar-button:end:decrement,.sidebar-panel-archives::-webkit-scrollbar-button:start:increment,.sidebar-panel-archives::-webkit-scrollbar-button:end:decrement,.sidebar-tags-list::-webkit-scrollbar-button:start:increment,.sidebar-tags-list::-webkit-scrollbar-button:end:decrement,.sidebar-categories-list::-webkit-scrollbar-button:start:increment,.sidebar-categories-list::-webkit-scrollbar-button:end:decrement,.highlight::-webkit-scrollbar-button:start:increment,.highlight::-webkit-scrollbar-button:end:decrement{display:none}html::-webkit-scrollbar-thumb,.sidebar-panel-archives::-webkit-scrollbar-thumb,.sidebar-tags-list::-webkit-scrollbar-thumb,.sidebar-categories-list::-webkit-scrollbar-thumb,.highlight::-webkit-scrollbar-thumb{border-radius:8px;background-color:rgba(0,0,0,0.2)}html::-webkit-scrollbar-track,html::-webkit-scrollbar-thumb,.sidebar-panel-archives::-webkit-scrollbar-track,.sidebar-panel-archives::-webkit-scrollbar-thumb,.sidebar-tags-list::-webkit-scrollbar-track,.sidebar-tags-list::-webkit-scrollbar-thumb,.sidebar-categories-list::-webkit-scrollbar-track,.sidebar-categories-list::-webkit-scrollbar-thumb,.highlight::-webkit-scrollbar-track,.highlight::-webkit-scrollbar-thumb{border:none}html::-webkit-scrollbar-thumb,.sidebar-panel-archives::-webkit-scrollbar-thumb,.sidebar-tags-list::-webkit-scrollbar-thumb,.sidebar-categories-list::-webkit-scrollbar-thumb,.highlight::-webkit-scrollbar-thumb{background-color:rgba(255,255,255,0.2);border-radius:0px}html::-webkit-scrollbar-track:hover,.sidebar-panel-archives::-webkit-scrollbar-track:hover,.sidebar-tags-list::-webkit-scrollbar-track:hover,.sidebar-categories-list::-webkit-scrollbar-track:hover,.highlight::-webkit-scrollbar-track:hover{background-color:rgba(0,0,0,0.1)}.sidebar-archive::-webkit-scrollbar-thumb,.sidebar-tags-list::-webkit-scrollbar-thumb,.sidebar-categories-list::-webkit-scrollbar-thumb{border-radius:8px;background-color:rgba(255,255,255,0.7)}.sidebar-archive::-webkit-scrollbar-thumb,.sidebar-tags-list::-webkit-scrollbar-thumb,.sidebar-categories-list::-webkit-scrollbar-thumb{background-color:rgba(255,255,255,0.7);border-radius:0px}.sidebar-archive::-webkit-scrollbar-track:hover,.sidebar-tags-list::-webkit-scrollbar-track:hover,.sidebar-categories-list::-webkit-scrollbar-track:hover{background-color:rgba(255,255,255,0.7)}.highlight::-webkit-scrollbar{height:5px}.highlight::-webkit-scrollbar-thumb{border-radius:8px;background-color:rgba(255,255,255,0.3)}.highlight::-webkit-scrollbar-thumb{background-color:rgba(255,255,255,0.3);border-radius:0px}.highlight::-webkit-scrollbar-track:hover{background-color:rgba(255,255,255,0.3)}@font-face{font-family:'iconfont-archer';src:url("//at.alicdn.com/t/font_327081_s1wbjxwfu9c.eot");src:url("//at.alicdn.com/t/font_327081_s1wbjxwfu9c.eot?#iefix") format("embedded-opentype"),url("//at.alicdn.com/t/font_327081_s1wbjxwfu9c.woff") format("woff"),url("//at.alicdn.com/t/font_327081_s1wbjxwfu9c.ttf") format("truetype"),url("//at.alicdn.com/t/font_327081_s1wbjxwfu9c.svg#iconfont-archer") format("svg")}.iconfont-archer{font-family:'iconfont-archer' !important;font-size:1rem;font-style:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.abstract-content pre,.abstract-content .highlight,.article-entry pre,.article-entry .highlight{margin:0.8rem 0;padding:0.7rem 0.7rem;overflow:auto;font-size:0.9rem;line-height:1.3rem}.abstract-content .highlight .gutter pre,.abstract-content .highlight .gutter pre .line,.abstract-content .gist .gist-file .gist-data .line-numbers,.article-entry .highlight .gutter pre,.article-entry .highlight .gutter pre .line,.article-entry .gist .gist-file .gist-data .line-numbers{color:#666}.abstract-content pre,.abstract-content code,.article-entry pre,.article-entry code{font-family:'Source Code Pro', Consolas, Menlo, Monaco, 'Courier New', monospace;font-weight:400}.abstract-content code,.article-entry code{background:#eee;padding:1px 0.4rem;border-radius:2px;margin:0 0.2rem;border:none}.abstract-content pre code,.article-entry pre code{background:none;text-shadow:none;padding:0;color:#657b83}.abstract-content .highlight,.article-entry .highlight{border-radius:4px}.abstract-content .highlight pre,.article-entry .highlight pre{border:none;margin:0;padding:0}.abstract-content .highlight table,.article-entry .highlight table{margin:0;width:auto}.abstract-content .highlight td,.article-entry .highlight td{border:none;padding:0}.abstract-content .highlight figcaption,.article-entry .highlight figcaption{color:highlight-comment;line-height:1em;margin-bottom:1em}.abstract-content .highlight figcaption:before,.abstract-content .highlight figcaption:after,.article-entry .highlight figcaption:before,.article-entry .highlight figcaption:after{content:'';display:table}.abstract-content .highlight figcaption:after,.article-entry .highlight figcaption:after{clear:both}.abstract-content .highlight figcaption a,.article-entry .highlight figcaption a{float:right}.abstract-content .highlight .gutter pre,.article-entry .highlight .gutter pre{text-align:right;padding-right:20px}.abstract-content .highlight .gutter pre .line,.article-entry .highlight .gutter pre .line{text-shadow:none}.abstract-content .highlight .line,.article-entry .highlight .line{min-height:19px}.abstract-content .highlight,.abstract-content pre,.article-entry .highlight,.article-entry pre{color:#abb2bf;background:#282c34}.abstract-content .highlight pre .comment,.abstract-content .highlight pre .quote,.article-entry .highlight pre .comment,.article-entry .highlight pre .quote{color:#5c6370;font-style:italic}.abstract-content .highlight pre .doctag,.abstract-content .highlight pre .keyword,.abstract-content .highlight pre .formula,.article-entry .highlight pre .doctag,.article-entry .highlight pre .keyword,.article-entry .highlight pre .formula{color:#c678dd}.abstract-content .highlight pre .section,.abstract-content .highlight pre .name,.abstract-content .highlight pre .selector-tag,.abstract-content .highlight pre .deletion,.abstract-content .highlight pre .subst,.article-entry .highlight pre .section,.article-entry .highlight pre .name,.article-entry .highlight pre .selector-tag,.article-entry .highlight pre .deletion,.article-entry .highlight pre .subst{color:#e06c75}.abstract-content .highlight pre .literal,.article-entry .highlight pre .literal{color:#56b6c2}.abstract-content .highlight pre .string,.abstract-content .highlight pre .regexp,.abstract-content .highlight pre .addition,.abstract-content .highlight pre .attribute,.abstract-content .highlight pre .meta-string,.article-entry .highlight pre .string,.article-entry .highlight pre .regexp,.article-entry .highlight pre .addition,.article-entry .highlight pre .attribute,.article-entry .highlight pre .meta-string{color:#98c379}.abstract-content .highlight pre .built_in,.abstract-content .highlight pre .class pre .title,.article-entry .highlight pre .built_in,.article-entry .highlight pre .class pre .title{color:#e6c07b}.abstract-content .highlight pre .attr,.abstract-content .highlight pre .variable,.abstract-content .highlight pre .template-variable,.abstract-content .highlight pre .type,.abstract-content .highlight pre .selector-class,.abstract-content .highlight pre .selector-attr,.abstract-content .highlight pre .selector-pseudo,.abstract-content .highlight pre .number,.article-entry .highlight pre .attr,.article-entry .highlight pre .variable,.article-entry .highlight pre .template-variable,.article-entry .highlight pre .type,.article-entry .highlight pre .selector-class,.article-entry .highlight pre .selector-attr,.article-entry .highlight pre .selector-pseudo,.article-entry .highlight pre .number{color:#d19a66}.abstract-content .highlight pre .symbol,.abstract-content .highlight pre .bullet,.abstract-content .highlight pre .link,.abstract-content .highlight pre .meta,.abstract-content .highlight pre .selector-id,.abstract-content .highlight pre .title,.article-entry .highlight pre .symbol,.article-entry .highlight pre .bullet,.article-entry .highlight pre .link,.article-entry .highlight pre .meta,.article-entry .highlight pre .selector-id,.article-entry .highlight pre .title{color:#61aeee}.abstract-content .highlight pre .emphasis,.article-entry .highlight pre .emphasis{font-style:italic}.abstract-content .highlight pre .strong,.article-entry .highlight pre .strong{font-weight:bold}.abstract-content .highlight pre .link,.article-entry .highlight pre .link{text-decoration:underline}.abstract-content .gist,.article-entry .gist{margin:0 -20px;border-style:solid;border-color:#ddd;border-width:1px 0;background:#272822;padding:15px 20px 15px 0}.abstract-content .gist .gist-file,.article-entry .gist .gist-file{border:none;font-family:'Source Code Pro', Consolas, Monaco, Menlo, Consolas, monospace;margin:0}.abstract-content .gist .gist-file .gist-data,.article-entry .gist .gist-file .gist-data{background:none;border:none}.abstract-content .gist .gist-file .gist-data .line-numbers,.article-entry .gist .gist-file .gist-data .line-numbers{background:none;border:none;padding:0 20px 0 0}.abstract-content .gist .gist-file .gist-data .line-data,.article-entry .gist .gist-file .gist-data .line-data{padding:0 !important}.abstract-content .gist .gist-file .highlight,.article-entry .gist .gist-file .highlight{margin:0;padding:0;border:none}.abstract-content .gist .gist-file .gist-meta,.article-entry .gist .gist-file .gist-meta{background:#272822;color:highlight-comment;font:0.85em 'Helvetica Neue', Helvetica, Arial, sans-serif;text-shadow:0 0;padding:0;margin-top:1em;margin-left:20px}.abstract-content .gist .gist-file .gist-meta a,.article-entry .gist .gist-file .gist-meta a{color:#258fb8;font-weight:normal}.abstract-content .gist .gist-file .gist-meta a:hover,.article-entry .gist .gist-file .gist-meta a:hover{text-decoration:underline}@font-face{font-family:'iconfont-archer';src:url("//at.alicdn.com/t/font_327081_s1wbjxwfu9c.eot");src:url("//at.alicdn.com/t/font_327081_s1wbjxwfu9c.eot?#iefix") format("embedded-opentype"),url("//at.alicdn.com/t/font_327081_s1wbjxwfu9c.woff") format("woff"),url("//at.alicdn.com/t/font_327081_s1wbjxwfu9c.ttf") format("truetype"),url("//at.alicdn.com/t/font_327081_s1wbjxwfu9c.svg#iconfont-archer") format("svg")}.iconfont-archer{font-family:'iconfont-archer' !important;font-size:1rem;font-style:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.sidebar-panel-archives{padding:1rem}.sidebar-panel-archives ul{padding:0;margin:0}.ps__rail-x,.ps__rail-y{display:none !important}.post-archive{overflow-y:auto}.archive-post-item,.meta-post-item{vertical-align:middle;border-left:1px solid #bbb;margin-left:0.3rem;padding:0.1rem 0 0.1rem 0.5rem;box-sizing:border-box}.archive-post-item:hover,.meta-post-item:hover{border-left-color:#f75357}.archive-post-item:hover .archive-post-date,.meta-post-item:hover .archive-post-date,.archive-post-item:hover .meta-post-date,.meta-post-item:hover .meta-post-date,.archive-post-item:hover .archive-post-title,.meta-post-item:hover .archive-post-title,.archive-post-item:hover .meta-post-title,.meta-post-item:hover .meta-post-title{color:#f75357}.total-and-search{display:flex}.site-search .search-icon{cursor:pointer;color:#f75357;line-height:1.9rem;font-size:1.5rem;position:relative;margin-left:0.5rem}.archive-year,.total-archive{font:1.2rem "Oswald-Regular";color:#f75357}.archive-year{font-size:1rem;margin-bottom:0.3rem}.archive-post-date,.meta-post-date{font:0.9rem/1rem "Oswald-Regular";color:#999}.archive-post-title,.meta-post-title{font-size:1rem;margin-left:0.8rem;text-align:left;color:#ccc}.sidebar-panel-tags,.sidebar-panel-categories{padding:1rem 1rem 5px 1rem;position:relative;display:flex;flex-direction:column}.sidebar-tags-name,.sidebar-categories-name{flex-grow:0;width:100%;padding:0 0 1rem 0;max-height:28rem;overflow:auto}.sidebar-tag-name,.sidebar-category-name{display:inline-block;border:1px solid #fff;border-radius:5rem;padding:0.07rem 0.4rem 0.1rem 0.4rem;margin:0.2rem 0;white-space:nowrap;font-size:1rem;cursor:pointer;color:#fff}.sidebar-tag-name:hover,.sidebar-category-name:hover{border-color:#f75357;color:#f75357}.sidebar-tag-name .iconfont-archer,.sidebar-category-name .iconfont-archer{pointer-events:none;transform:translateY(-1rem);font-size:0.6rem;margin:0 0.3rem 0 0.1rem}.sidebar-category-name .iconfont-archer{font-size:16px}.sidebar-tags-empty,.sidebar-categories-empty{display:none}.sidebar-tags-empty-active,.sidebar-categories-empty-active{display:block;font-size:6rem !important;margin-top:7rem;user-select:none;text-align:center;color:#fff}.sidebar-label-focus{border-color:#f75357;color:#f75357}.sidebar-tags-list,.sidebar-categories-list{flex-grow:1;padding:1rem 1rem 0 0;overflow-y:auto}.sidebar{position:fixed;display:flex;flex-direction:column;left:0;top:0;z-index:0;height:100%;width:400px;transition:all 0.3s ease-in 0s;overflow-x:hidden;background-color:#222}.sidebar-hide{display:none}.sidebar-tabs{display:flex;position:relative;padding:0;margin:0;height:4rem;width:100%;z-index:1001;justify-content:space-around;align-items:flex-start;font-family:"Oswald-Regular";flex-grow:0;color:#eee;border-bottom:2px solid #666}.sidebar-tabs::after{content:'';position:absolute;width:33.33%;height:2px;left:0;top:100%;background-color:#f75357;transform:translate3d(0, 0, 0);transition:transform 0.2s ease-out 0s}.sidebar-tab-archives,.sidebar-tab-tags,.sidebar-tab-categories{display:flex;align-items:center;justify-content:center;font-size:1.3rem;width:33.333%;height:100%;cursor:pointer}.sidebar-tab-archives .iconfont-archer,.sidebar-tab-tags .iconfont-archer,.sidebar-tab-categories .iconfont-archer{pointer-events:none;margin:0 0.5rem 0 0rem;font-size:1.5rem}.tab-name{pointer-events:none;font-size:1.5rem;margin-left:0.2rem}.sidebar-tabs-active-0::after{transform:translate3d(0, 0, 0)}.sidebar-tabs-active-1::after{transform:translate3d(100%, 0, 0)}.sidebar-tabs-active-2::after{transform:translate3d(200%, 0, 0)}.sidebar-content{position:relative;display:flex;width:300%;height:calc(100% - 4rem);top:0;left:0;transition:transform 0.3s ease-out 0s;overflow-x:hidden;transform:translate3d(0, 0, 0)}.sidebar-panel-archives,.sidebar-panel-tags,.sidebar-panel-categories{overflow-x:hidden;overflow-y:auto;flex-shrink:0;width:calc(33.33% - 2rem);-webkit-overflow-scrolling:touch;overflow-scrolling:touch}.sidebar-content-active-0{transform:translate3d(0, 0, 0)}.sidebar-content-active-1{transform:translate3d(-33.33%, 0, 0)}.sidebar-content-active-2{transform:translate3d(-66.67%, 0, 0)}.index-post{position:relative;padding:1rem 0rem 1rem 0rem;border-bottom:1px dashed rgba(0,0,0,0.2);z-index:3}.index-post .abstract-content{color:#585858;font-size:1rem;line-height:1.6rem;font-weight:300;word-break:break-word}.index-post .abstract-content img{max-width:100%;box-shadow:none}.abstract-title{line-height:2.5rem;color:#1f1f1f;padding-bottom:0.5rem}.abstract-title span:last-of-type{transition:color 0.1s ease-in;font-size:1.7rem}.abstract-title span:last-of-type:hover{color:#f75357}.stick-top{font-size:1.3rem;margin-right:0.2rem}.abstract-post-meta{display:flex;justify-content:space-between;padding:0.5rem 0 0 0;font-family:"Oswald-Regular";color:#aaa;height:1.5rem}.post-tag{font-size:1rem;position:relative;color:#aaa;margin-left:0.4rem;font-weight:lighter}.post-tag::before{margin-right:2px;content:'#'}.post-tag::after{content:'';position:absolute;left:calc((100% - 98%) / 2);bottom:-15%;transition:all 0.15s ease-in;width:98%;height:2px;transform:translate(0, 0);background-color:#aaa;opacity:0}.post-tag:hover::after{transform:translate(0, -2px);opacity:1}.abstract-calander{position:relative;top:-0.1rem;margin-right:0.3rem;font-size:1rem}@font-face{font-family:'iconfont-archer';src:url("//at.alicdn.com/t/font_327081_s1wbjxwfu9c.eot");src:url("//at.alicdn.com/t/font_327081_s1wbjxwfu9c.eot?#iefix") format("embedded-opentype"),url("//at.alicdn.com/t/font_327081_s1wbjxwfu9c.woff") format("woff"),url("//at.alicdn.com/t/font_327081_s1wbjxwfu9c.ttf") format("truetype"),url("//at.alicdn.com/t/font_327081_s1wbjxwfu9c.svg#iconfont-archer") format("svg")}.iconfont-archer{font-family:'iconfont-archer' !important;font-size:1rem;font-style:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.post-body main,.about-body main{margin:0}.anchorjs-archer{color:#f75357;border:none !important}.post-body .site-intro-meta,.about-body .site-intro-meta{width:50%;min-width:42.8125rem;margin:0 auto;align-items:flex-start}.post-body .intro-title,.about-body .intro-title{font:4rem/5.3rem "Oswald-Regular";color:#fff;margin:0}.post-intros{opacity:0;transition:all 0.5s ease-out 0.5s;transform:translate3d(0, -1rem, 0)}.post-intro-tags{font:1.2rem "Oswald-Regular"}.post-intro-tags .post-tag{position:relative;margin-left:0;margin-right:0.5rem;font-size:1.2rem;color:#fff}.post-intro-tags .post-tag::after{content:'';position:absolute;left:calc((100% - 98%) / 2);bottom:-15%;transition:all 0.15s ease-in;width:98%;height:2px;transform:translate(0, 0);background-color:#fff;opacity:0}.post-intro-tags .post-tag:hover::after{transform:translate(0, -2px);opacity:1}.post-intro-tags .post-tag::before{content:'#'}.post-intro-meta{margin-top:0.2rem;font:1.1rem "Oswald-Regular";color:#fff;display:flex;align-items:center}.post-intro-read{margin-top:0.2rem;font:0.9rem "Oswald-Regular";color:#fff;display:flex;align-items:center}.word-count{margin-right:1rem}.post-fade-in{opacity:1;transform:translate3d(0, 0, 0)}.post-intro-calander{font-size:0.9rem;margin-right:0.3rem}.post-intro-time{font-size:0.9rem;margin-right:0.5rem}.busuanzi-pv,.busuanzi-uv{font-size:0.9rem;margin-right:0.4rem}.shareWrapper{position:relative;font-size:0.9rem;padding:0 0.5rem 0 0}.shareWrapper:hover .shareList{visibility:visible;opacity:1}.shareIcon{font-size:0.9rem;cursor:pointer}.shareText{font-family:"Oswald-Regular";cursor:pointer}.shareList{position:absolute;visibility:hidden;margin:0;padding:0;left:100%;bottom:0;display:flex;opacity:0;transition:all 0.1s ease-in 0s}.shareList .iconfont-archer{display:inline-block;margin-right:3px;cursor:pointer}.shareList .iconfont-archer:hover{color:#aaa}.shareList [data-type='weibo']{position:relative;top:-2px}.shareList [data-type='facebook']{position:relative;top:1px}.share-qr{position:relative}.share-qrcode{position:absolute;left:0;bottom:1.5rem;visibility:hidden;opacity:0;transition:all 0.1s ease-in 0s}.share-qr:hover .share-qrcode{visibility:visible;opacity:1}.post-paginator{overflow:hidden;margin:0;list-style:none;padding:2.5rem 0 1rem 0;display:flex;justify-content:space-between}.post-paginator li{position:relative;max-width:13rem}.post-paginator .nextTitle,.post-paginator .prevTitle{font-size:1.2rem;color:#ccc}.post-paginator .nextTitle:hover,.post-paginator .prevTitle:hover{color:#f75357}.post-paginator .nextSlogan,.post-paginator .prevSlogan{font:bold 1.4rem "Oswald-Regular";color:#252525}.post-paginator .nextSlogan::before{content:'< ';font-size:1.7rem}.post-paginator .prevSlogan::after{content:' >';font-size:1.7rem}.abstract-content,.article-entry{position:relative;padding:1px 0;font-weight:lighter;font-weight:400;color:#23394d}.abstract-content ul,.abstract-content ul li,.article-entry ul,.article-entry ul li{list-style-type:initial}.abstract-content ol,.abstract-content ol li,.article-entry ol,.article-entry ol li{list-style-type:decimal-leading-zero}.abstract-content h1:first-child,.article-entry h1:first-child{margin-top:0}.abstract-content h2:first-child,.article-entry h2:first-child{margin-top:0}.abstract-content h3:first-child,.article-entry h3:first-child{margin-top:0}.abstract-content h4:first-child,.article-entry h4:first-child{margin-top:0}.abstract-content h5:first-child,.article-entry h5:first-child{margin-top:0}.abstract-content h6:first-child,.article-entry h6:first-child{margin-top:0}.abstract-content h5,.article-entry h5{font-size:1rem;margin:1rem 0}.abstract-content h6,.article-entry h6{font-size:0.8rem;margin:1rem 0}.abstract-content p,.article-entry p{line-height:1.625}.abstract-content em,.article-entry em{font-style:italic}.abstract-content img,.article-entry img{display:block;max-width:100%;margin:1rem auto 1rem;box-shadow:0 0 4px 2px rgba(0,0,0,0.2)}.abstract-content blockquote,.article-entry blockquote{margin:1.5em 0 1.5rem 0;padding:10px 20px;position:relative;background-color:#f6f6f6;border-left:3px solid #f75357}.abstract-content blockquote p,.article-entry blockquote p{margin:0}.abstract-content .table-container table,.abstract-content>table,.article-entry .table-container table,.article-entry>table{width:100%;border:1px solid #ddd;margin:1rem 0;border-collapse:collapse;box-shadow:2px 2px 2px rgba(0,0,0,0.125)}.abstract-content .table-container table tr,.abstract-content .table-container table td,.abstract-content>table tr,.abstract-content>table td,.article-entry .table-container table tr,.article-entry .table-container table td,.article-entry>table tr,.article-entry>table td{height:2rem}.abstract-content .table-container table thead tr,.abstract-content>table thead tr,.article-entry .table-container table thead tr,.article-entry>table thead tr{background:#f8f8f8}.abstract-content .table-container table tbody tr:hover,.abstract-content>table tbody tr:hover,.article-entry .table-container table tbody tr:hover,.article-entry>table tbody tr:hover{background:#efefef}.abstract-content .table-container table td,.abstract-content .table-container table th,.abstract-content>table td,.abstract-content>table th,.article-entry .table-container table td,.article-entry .table-container table th,.article-entry>table td,.article-entry>table th{border:1px solid #dedede;padding:0.2rem 1rem 0 1rem}.abstract-content a,.article-entry a{color:#f75357;padding:0 0 0 2px;word-break:break-all}.abstract-content a:hover,.article-entry a:hover{border-bottom:1px solid #f75357}.abstract-content a.fancybox,.article-entry a.fancybox{border:0}.license-wrapper{font-weight:300;line-height:1.5rem;border-top:1px dashed #ccc;border-bottom:1px dashed #ccc;color:#23394d}.license-wrapper p{margin:0.2rem 0}.license-wrapper a{color:#f75357}.toc-wrapper{display:block;position:absolute;top:50vh;width:22%;right:1%;overflow:hidden;max-width:calc((100% - 42.8125rem - 4rem) / 2);z-index:9999;margin:calc(3.5rem + 1rem) 0 0 0;transform:translate3d(0, 0, 0);transition:transform 0.3s ease-out 0s}.toc-wrapper .toc-active{color:#f75357}.toc-catalog{color:#bbb;cursor:pointer;user-select:none;font:bolder 1.2rem "Oswald-Regular"}.toc-catalog:hover{color:#f75357}.catalog-icon{position:relative;top:-0.1rem;margin-right:0.3rem}.toc,.toc-child{padding-left:0;margin:0 0 0 0}.toc-wrapper>*{transform:translate(0, 0);transition:transform 0.3s ease-out, opacity 0.3s ease-out;opacity:1}.toc-wrapper ol{padding-left:1rem}.toc-wrapper .toc-number{font-weight:bold}.toc-wrapper a{color:#ddd}.toc-wrapper a:hover{color:#f75357 !important}.toc-hide-children>*{transform:translate(-100%, 0);opacity:0}.toc-hide-children .toc-catalog{display:block;transform:none;opacity:1}.toc-fixed{position:fixed;top:0rem !important}.toc-slide{transform:translate3d(400px, 0, 0)}.toc-hide{display:none}.four-zero-four-body .loading{display:none !important}.four-zero-four-body .site-intro{height:100%}.four-zero-four-body .site-intro-meta{height:80%}.four-zero-four-body .wrapper{height:100vh;padding-bottom:0}.four-zero-four-body .container{padding:0}.four-zero-four-body .footer{width:100%;z-index:30;background-color:transparent;position:absolute;bottom:0}.four-zero-four-body .iconfont-archer::before{color:rgba(255,255,255,0.5)}.four-zero-four-body .copyright{color:#fff} diff --git a/src/scss/dark.scss b/src/scss/dark.scss index 28c717dc..18b23636 100644 --- a/src/scss/dark.scss +++ b/src/scss/dark.scss @@ -9,23 +9,26 @@ background-color: $body-background-dark-color; } + .profile-name { + color: #ddd !important; + } + .wrapper { box-shadow: -3px 0 2px 0 rgba(255, 255, 255, 0.6) !important; } .back-top { - border: 2px solid #fff; - background-color: rgba(18, 18, 18, 0.8); - cursor: pointer; - color: #fff; + border: 2px solid #fff !important; + background-color: rgba(18, 18, 18, 0.8) !important; + color: #fff !important; &:hover { - background-color: #fff; - color: #121212; + background-color: #fff !important; + color: #121212 !important; } } .note-warning { - background-color: #222; + background-color: #222 !important; } .abstract-title { From bb2e857857f41bfc965adbb94628429573b4b29b Mon Sep 17 00:00:00 2001 From: akira Date: Sat, 5 Jun 2021 21:43:25 +0800 Subject: [PATCH 06/23] enhancement: support mermaid diagram --- _config.yml | 7 +++++++ layout/_partial/base-footer.ejs | 9 +++++++++ 2 files changed, 16 insertions(+) diff --git a/_config.yml b/_config.yml index 0939ae7c..a9fd212d 100755 --- a/_config.yml +++ b/_config.yml @@ -131,3 +131,10 @@ copyright: license: '本文采用知识共享署名-非商业性使用 4.0 国际许可协议进行许可' # Blog page article timeliness days reminder, 0 for no threshold outdated_threshold: 0 + +# mermaid chart +mermaid: ## mermaid url https://github.com/knsv/mermaid + enable: true # default true + version: "7.1.2" # default v7.1.2 + options: # find more api options from https://github.com/knsv/mermaid/blob/master/src/mermaidAPI.js + #startOnload: true // default true diff --git a/layout/_partial/base-footer.ejs b/layout/_partial/base-footer.ejs index 8a99d0f9..4366d607 100644 --- a/layout/_partial/base-footer.ejs +++ b/layout/_partial/base-footer.ejs @@ -20,4 +20,13 @@ <% } %> <% } %> + + <% if (theme.mermaid.enable) { %> + + + <% } %> \ No newline at end of file From 8c242d6106cbb259abe3bbcb9b93425b7564fd68 Mon Sep 17 00:00:00 2001 From: Lolipop Date: Sun, 18 Jul 2021 03:14:08 +0800 Subject: [PATCH 07/23] chore: fix code style & udpate deps version & update docs 1. Fix code style: fix .ejs files' code style, as a must be done thing. 2. Update deps version: update jquery, fancybox, instantsearch.js and so on. 3. Update docs: there are so many issues (like #168, #231) caused by installing instruction, so I just update related docs. 4. One more thing: unify the majority of CDN links to `cdn.jsdelivr.net` --- README.md | 58 +- _config.yml | 24 +- gulpfile.js | 2 +- layout/404.ejs | 2 +- layout/_partial/algolia.ejs | 33 +- layout/_partial/base-background-image.ejs | 40 +- layout/_partial/base-footer-fixed.ejs | 16 +- layout/_partial/base-footer.ejs | 63 +- layout/_partial/base-head.ejs | 81 +- layout/_partial/base-header.ejs | 40 +- layout/_partial/base-preload-polyfill.ejs | 182 ++-- layout/_partial/base-profile.ejs | 22 +- layout/_partial/base-social.ejs | 2 +- layout/_partial/base-title-tags.ejs | 2 +- layout/_partial/comment/changyan.ejs | 59 +- layout/_partial/comment/disqus.ejs | 5 +- layout/_partial/comment/gitalk.ejs | 11 +- layout/_partial/comment/gitment.ejs | 35 +- layout/_partial/comment/livere.ejs | 5 +- layout/_partial/comment/utteranc.ejs | 20 +- layout/_partial/comment/valine.ejs | 22 +- layout/_partial/comment/youyan.ejs | 2 +- .../_partial/critical-css/critical-style.ejs | 1 - layout/_partial/intro-height.ejs | 8 +- layout/_partial/script/font-loader.ejs | 143 +-- layout/_partial/sidebar/base-sidebar.ejs | 2 +- layout/_partial/sidebar/sidebar-archives.ejs | 46 +- .../_partial/sidebar/sidebar-categories.ejs | 2 +- layout/_partial/sidebar/sidebar-tags.ejs | 57 +- layout/about.ejs | 4 +- layout/index.ejs | 75 +- layout/layout.ejs | 143 +-- layout/post.ejs | 50 +- layout/site-meta.ejs | 2 +- package-lock.json | 918 +++++++----------- package.json | 17 +- source/css/mobile.css.map | 2 +- source/css/style.css | 2 +- source/css/style.css.map | 2 +- source/lib/jquery.min.js | 4 +- source/lib/webfontloader.min.js | 2 +- source/scripts/main.js | 2 +- source/scripts/main.js.map | 2 +- source/scripts/search.js | 3 +- source/scripts/search.js.LICENSE.txt | 1 - source/scripts/search.js.map | 2 +- src/js/main.js | 4 +- src/js/search.js | 2 - src/scss/{dark.scss => _dark.scss} | 91 +- src/scss/style.scss | 4 +- webpack.config.js | 1 - 51 files changed, 1081 insertions(+), 1237 deletions(-) delete mode 100644 source/scripts/search.js.LICENSE.txt rename src/scss/{dark.scss => _dark.scss} (60%) diff --git a/README.md b/README.md index deeb60ee..97b48a54 100644 --- a/README.md +++ b/README.md @@ -17,21 +17,30 @@ - 本主题受 [yilia](https://github.com/litten/hexo-theme-yilia) 主题和 [huxpro](https://github.com/Huxpro/huxpro.github.io) 主题的启发,结合了前者的 sidebar 设计及后者的 UI 设计。通过 sidebar 能够快速执行 archive, tag 以及 categories 导航。 - 兼容性:现代浏览器及 IE10+。 -- 有任何使用上的问题欢迎 [**发起 issue**](https://github.com/fi3ework/hexo-theme-archer/wiki/%E5%90%AF%E7%94%A8-Algolia-%E6%90%9C%E7%B4%A2)。 +- 有任何使用上的问题欢迎 **发起 issue**。 ## 安装主题 -### 安装依赖,拉取 Archer 主题文件 +### 安装主题依赖 -在 Hexo 根目录下执行以下命令: +Archer 主题依赖于 `hexo-generator-json-content` 和 `hexo-wordcount`,因此需要在 Hexo 根目录执行以下命令: ``` bash -npm i hexo-generator-json-content --save && npm i --save hexo-wordcount && git clone https://github.com/fi3ework/hexo-theme-archer.git themes/archer --depth=1 +npm i hexo-generator-json-content --save +npm i hexo-wordcount --save +``` + +### 拉取主题文件 + +还是在 Hexo 根目录执行下面的命令: + +``` bash +git clone https://github.com/fi3ework/hexo-theme-archer.git themes/archer --depth=1 ``` 现在,Archer 主题已经顺利拉取到 `themes/archer` 目录下。 -### 设置 Hexo 主题为 Archer +### 设置 Hexo 博客主题为 Archer 修改 Hexo 根目录下的 `_config.yml` 文件中的 `theme` 字段为 `archer`: @@ -64,6 +73,10 @@ jsonContent: tags: true ``` +### 启动博客预览 + +在 Hexo 根目录下执行 `hexo s`,即可启用本地博客预览。 + ## 主题配置 现在您的博客项目的目录目录结构应当如下: @@ -77,19 +90,50 @@ jsonContent: └── _config.yml # Hexo 配置文件 ``` +您可以通过 `hexo -v` 命令,或在 Hexo 根目录下的 `package.json` 中查看您当前使用的 Hexo 版本。 + 如果 Hexo 版本 >= 5.0.0,建议首先复制 Archer 主题目录下的 [`_config.yml`](./_config.yml) 到 Hexo 根目录,并命名为 `_config.archer.yml`。接下来修改 Hexo 根目录下的这个 `_config.archer.yml` 文件即可对主题进行配置。 如果 Hexo 版本 >= 2.8.2,修改 Archer 主题目录下的 [`_config.yml`](./_config.yml) 文件即可对主题进行配置。 如果 Hexo 版本 < 2.8.2,请参考 Archer 主题目录下的 [`_config.yml`](./_config.yml) 中的配置,在 Hexo 根目录下的 `_config.yml` 添加相应字段即可进行配置。请注意不要添加重复字段。 -您可以在 Hexo 根目录下的 `package.json` 查看您当前使用的 Hexo 版本。 +上面三种情况的主题配置文件 `_config.archer.yml` 或 `_config.yml`,为与 Hexo 根目录下的全局配置文件 `_config.yml` 作区分,在后面的介绍中统称为「Archer 主题目录下的 `_config.yml`」。 这个[维基页面](https://github.com/fi3ework/hexo-theme-archer/wiki/Archer-%E4%B8%BB%E9%A2%98%E9%85%8D%E7%BD%AE%E4%BF%A1%E6%81%AF%E4%B8%AD%E6%96%87%E5%8F%82%E8%80%83)包含了主题配置属性的中文参考。 **警告**:不要把自己 api-token 之类的私密信息添加到配置中,更不要推送到公共仓库。 -### 可选配置 +### 启用 Mermaid + +[Mermaid](https://github.com/mermaid-js/mermaid) 是一款基于 JavaScript 的流程图和图表工具,它使用 Markdown 定义并渲染各种图表,帮助构建软件工程或各类技术文档。 + +为了启用 Mermaid,您需要首先在 Hexo 根目录下安装 [`hexo-filter-mermaid-diagrams`](https://github.com/webappdevelp/hexo-filter-mermaid-diagrams) 依赖: + +``` bash +npm install hexo-filter-mermaid-diagrams --save +``` + +然后在 Archer 主题目录下的 `_config.yml` 设置启用 Mermaid: + +``` yml +mermaid: + enable: true +``` + +现在,您可以在任意文章中添加下面的内容(需要去掉第一行和最后一行多的空格),测试 Mermaid 是否启用成功: + +``` plaintext +` `` mermaid +graph TD; + A-->B; + A-->C; + B-->D; + C-->D; +` `` +``` + +### 其它可选配置 - [启用 about 页](https://github.com/fi3ework/hexo-theme-archer/wiki/%E5%90%AF%E7%94%A8about%E9%A1%B5) - [启用 404 页](https://github.com/fi3ework/hexo-theme-archer/wiki/%E5%90%AF%E7%94%A8404%E9%A1%B5) diff --git a/_config.yml b/_config.yml index e2b8f931..e6abfc9d 100644 --- a/_config.yml +++ b/_config.yml @@ -31,9 +31,8 @@ social: rss: # friends friends: - friendA: //www.baidu.com - friendB: //www.google.com - friendC: + # friendA: //www.baidu.com + # friendB: //www.google.com about: enable: true image: '/intro/about-bg.jpg' @@ -57,6 +56,14 @@ post_header_image: '/intro/post-bg.jpg' # 404 image _404_image: '/intro/404-bg.jpg' +# ========== Theme ========== # +# Blog float button theme ('default' or 'rounded') +float_button_theme: default +# Blog read progress color ('default' for black or 'feature' for feature-color) +read_progress_color: default +# Blog post banner theme ('default' or 'clean') +post_banner_theme: default + # ========== Search ========== # algolia_search: enable: false @@ -141,14 +148,9 @@ website_approve: beian_img: /assets/beian.png # Blog page article timeliness days reminder, 0 for no threshold outdated_threshold: 0 -# Blog float button theme ('default' or 'rounded') -float_button_theme: default -# Blog read progress color ('default' for black or 'feature' for feature-color) -read_progress_color: default -# Blog post banner theme ('default' or 'clean') -post_banner_theme: default # Mermaid Chart: https://github.com/knsv/mermaid mermaid: - enable: true - version: '7.1.2' + enable: false + version: 8.11.0 + theme: dark options: # find more api options from https://github.com/knsv/mermaid/blob/master/src/mermaidAPI.js diff --git a/gulpfile.js b/gulpfile.js index 58e7d14e..94073ddd 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -3,7 +3,7 @@ const gulp = require('gulp'), sourcemaps = require('gulp-sourcemaps'), autoprefixer = require('autoprefixer'), webpack = require('webpack'), - sass = require('gulp-sass'), + sass = require('gulp-sass')(require('node-sass')), browserSync = require('browser-sync').create() /* ========== develop ========== */ diff --git a/layout/404.ejs b/layout/404.ejs index 0b99bc77..e1760c46 100644 --- a/layout/404.ejs +++ b/layout/404.ejs @@ -1 +1 @@ - + diff --git a/layout/_partial/algolia.ejs b/layout/_partial/algolia.ejs index 4b39251b..73d7168a 100644 --- a/layout/_partial/algolia.ejs +++ b/layout/_partial/algolia.ejs @@ -1,21 +1,20 @@ - diff --git a/layout/_partial/base-background-image.ejs b/layout/_partial/base-background-image.ejs index 7eac36e3..23396627 100644 --- a/layout/_partial/base-background-image.ejs +++ b/layout/_partial/base-background-image.ejs @@ -2,16 +2,16 @@ <% var bgURL; %> <% if (is_home()) { %> - <% bgURL = theme.site_header_image; %> + <% bgURL = theme.site_header_image; %> <% } else if (is_post()) { %> - <% bgURL = page.header_image || theme.post_header_image || theme.site_header_image; %> + <% bgURL = page.header_image || theme.post_header_image || theme.site_header_image; %> <% } else if (page.layout === "404") { %> - <% bgURL = theme._404_image || theme.site_header_image; %> + <% bgURL = theme._404_image || theme.site_header_image; %> <% } else if (page.layout === "about") { %> - <% bgURL = theme.about.image || theme.site_header_image; %> + <% bgURL = theme.about.image || theme.site_header_image; %> <% } %>
@@ -20,36 +20,36 @@

<% if (is_home()) { %> - <%- theme.main_title || config.title%> + <%- theme.main_title || config.title %> <% } else if(is_post()) { %> - <%- truncate(strip_html(page.title), {length: 80, omission: '...'}) || '[Untitled Post]' %> + <%- truncate(strip_html(page.title), {length: 80, omission: '...'}) || '[Untitled Post]' %> <% } else if(page.layout === "404") { %> - <%- page.title || '[404]'%> + <%- page.title || '[404]'%> <% } else if(page.layout === "about" ) { %> - <%- page.title || 'About' %> + <%- page.title || 'About' %> <% } %>

<% if (is_home()) { %> - <% if(typeof theme.subtitle === 'string') { %> - <%- theme.subtitle %> - <% } %> + <% if(typeof theme.subtitle === 'string') { %> + <%- theme.subtitle %> + <% } %> <% } else if (is_post()) { %> - <% if(typeof page.subtitle === 'string') { %> - <%- page.subtitle %> - <% } %> + <% if(typeof page.subtitle === 'string') { %> + <%- page.subtitle %> + <% } %> <% } else if (page.layout === "404") { %> <%- page.description %> <% } %>

- + <% if(is_post()) { %>
@@ -67,10 +67,10 @@ <%- date(page.date, "YYYY/MM/DD") %> <% if (theme.busuanzi) { %> - - - - + + + + <% } %> @@ -89,4 +89,4 @@
<% } %> - \ No newline at end of file + diff --git a/layout/_partial/base-footer-fixed.ejs b/layout/_partial/base-footer-fixed.ejs index 37b35fbb..e180b161 100644 --- a/layout/_partial/base-footer-fixed.ejs +++ b/layout/_partial/base-footer-fixed.ejs @@ -1,20 +1,20 @@ <% if(is_home()) { %> -
+
<% } else { %> -
+
<% } %>
\ No newline at end of file +
diff --git a/layout/_partial/base-footer.ejs b/layout/_partial/base-footer.ejs index 2875db4e..0ccd2f17 100644 --- a/layout/_partial/base-footer.ejs +++ b/layout/_partial/base-footer.ejs @@ -1,9 +1,9 @@
<% if(theme.social) { %> - + <% } %> <% if(theme.website_approve.enable) { %> -
- <% if(theme.website_approve.icp_approve) { %> - - <%- theme.website_approve.icp_approve %> - - <% } %> - <% if(theme.website_approve.beian_approve && theme.website_approve.beian_img) { %> - <% const beianPath = theme.website_approve.beian_img %> - - - 京公网安备 <%- theme.website_approve.beian_approve %>号 - - <% } %> -
+
+ <% if(theme.website_approve.icp_approve) { %> + + <%- theme.website_approve.icp_approve %> + + <% } %> + <% if(theme.website_approve.beian_approve && theme.website_approve.beian_img) { %> + <% const beianPath = theme.website_approve.beian_img %> + + + 京公网安备 <%- theme.website_approve.beian_approve %>号 + + <% } %> +
<% } %> <% if (theme.busuanzi) { %> -
- <% var sloganPieces = theme.busuanzi_slug.split('${count}') %> - <% if(theme.busuanzi_pv_or_uv === 'pv') { %> - <%- sloganPieces[0] %><%- sloganPieces[1] %> - <% } else if (theme.busuanzi_pv_or_uv === 'uv') { %> - <%- sloganPieces[0] %><%- sloganPieces[1] %> - <% } %> -
- <% } %> - - <% if (theme.mermaid.enable) { %> - - - <% } %> -
\ No newline at end of file +
+ <% var sloganPieces = theme.busuanzi_slug.split('${count}') %> + <% if(theme.busuanzi_pv_or_uv === 'pv') { %> + <%- sloganPieces[0] %><%- sloganPieces[1] %> + <% } else if (theme.busuanzi_pv_or_uv === 'uv') { %> + <%- sloganPieces[0] %><%- sloganPieces[1] %> + <% } %> +
+ <% } %> +
diff --git a/layout/_partial/base-head.ejs b/layout/_partial/base-head.ejs index c673d7d7..54fa2cf0 100755 --- a/layout/_partial/base-head.ejs +++ b/layout/_partial/base-head.ejs @@ -1,9 +1,9 @@ <% var title = "" %> <% if (page.title) { %> -<% title = page.title + ' · ' + theme.SEO_title || config.title %> -<% } else {%> -<% title = theme.SEO_title %> + <% title = page.title + ' · ' + theme.SEO_title || config.title %> +<% } else { %> + <% title = theme.SEO_title %> <% } %> <% var keywords = "" %> @@ -12,41 +12,38 @@ <% console.log(keywords) %> - + <% if (keywords){ %> - + <% } else { %> - + <% } %> <%- open_graph({twitter_id: theme.twitter, google_plus: theme.google_plus, fb_admins: theme.fb_admins, fb_app_id: theme.fb_app_id}) %> - + + <% if (theme.feed != undefined) { %> - + <% } %> <%= title %> <%- partial('critical-css/critical-style') %> - " as="style" onload="this.onload=null;this.rel='stylesheet'" /> - " media="(max-width: 980px)"> - <% if(!is_home()) { %> - - <% } %> + " as="style" onload="this.onload=null;this.rel='stylesheet'"> + " media="(max-width: 980px)"> + <%- partial('base-preload-polyfill') %> - - - - - - - + + + + + + + <% if (theme.algolia_search != undefined && theme.algolia_search.enable) { %> - <% } %> - - <% if(theme.baidu_analytics) { %> - + <% } %> <% if (theme.google_analytics) { %> - + <% } %> diff --git a/layout/_partial/base-header.ejs b/layout/_partial/base-header.ejs index ad365db9..55d6917f 100755 --- a/layout/_partial/base-header.ejs +++ b/layout/_partial/base-header.ejs @@ -1,27 +1,27 @@ <% if(is_home()) { %> -
+
<% } else { %> -
+
<% } %>
<% if(theme.read_progress_color === 'feature') { %> -
+
<% } else { %> -
+
<% } %>
<% if(theme.float_button_theme === 'rounded') { %> -
+
<% } else { %> -
+
<% } %> <% if(theme.float_button_theme === 'rounded') { %> - + <% } else { %> -
+
<% } %>
@@ -29,17 +29,17 @@ ><%- theme.main_title || config.title %> <% if (is_post()) { %> - <% if(theme.post_banner_theme === 'clean') { %> -
\ No newline at end of file +
diff --git a/layout/_partial/base-preload-polyfill.ejs b/layout/_partial/base-preload-polyfill.ejs index 415a0dbb..e7a7ef67 100644 --- a/layout/_partial/base-preload-polyfill.ejs +++ b/layout/_partial/base-preload-polyfill.ejs @@ -5,102 +5,104 @@ - applying rel preload css once loaded, whether supported or not. */ --> diff --git a/layout/_partial/base-profile.ejs b/layout/_partial/base-profile.ejs index 29e332ab..f36fbc57 100644 --- a/layout/_partial/base-profile.ejs +++ b/layout/_partial/base-profile.ejs @@ -1,15 +1,15 @@
- avatar > + avatar />
<%- theme.author || config.author %>
- <% if(theme.signature && theme.signature.length !== 0) {%> -
- <%= theme.signature %> -
+ <% if(theme.signature && theme.signature.length !== 0) { %> +
+ <%= theme.signature %> +
<% } %> <% if(theme.social) { %> -
- <%- partial('base-social') %> -
+
+ <%- partial('base-social') %> +
<% } %> <% if(theme.friends) { %>
@@ -17,7 +17,7 @@ <% for (name in theme.friends) { %> <% if(theme.friends[name]) { %> - target="_black"><%- name %> + <%- name %> <% } %> <% } %> @@ -25,7 +25,7 @@ <% } %> <% if(theme.about.enable) { %> <% } %> -
\ No newline at end of file +
diff --git a/layout/_partial/base-social.ejs b/layout/_partial/base-social.ejs index acc95f05..9df48c98 100644 --- a/layout/_partial/base-social.ejs +++ b/layout/_partial/base-social.ejs @@ -13,4 +13,4 @@ <% } %> <% } %> <% } %> -<% } %> \ No newline at end of file +<% } %> diff --git a/layout/_partial/base-title-tags.ejs b/layout/_partial/base-title-tags.ejs index 2085d481..8d1f68bb 100644 --- a/layout/_partial/base-title-tags.ejs +++ b/layout/_partial/base-title-tags.ejs @@ -2,4 +2,4 @@ <% currPost.tags.forEach(function (tag, i) { %> <% }) %> - \ No newline at end of file + diff --git a/layout/_partial/comment/changyan.ejs b/layout/_partial/comment/changyan.ejs index b9a46275..5eb2ffa0 100644 --- a/layout/_partial/comment/changyan.ejs +++ b/layout/_partial/comment/changyan.ejs @@ -1,11 +1,48 @@ - -<% if(theme.comment && theme.comment.changyan_appid && theme.comment.changyan_conf) { %> -
- -<% } %> \ No newline at end of file + +<% if (theme.comment && theme.comment.changyan_appid && theme.comment.changyan_conf) { %> +
+ +<% } %> diff --git a/layout/_partial/comment/disqus.ejs b/layout/_partial/comment/disqus.ejs index 5de7642c..b6498eea 100644 --- a/layout/_partial/comment/disqus.ejs +++ b/layout/_partial/comment/disqus.ejs @@ -1,4 +1,4 @@ -<% if(theme.comment && theme.comment.disqus_shortname) { %> +<% if (theme.comment && theme.comment.disqus_shortname) { %>
-<% } %> \ No newline at end of file +<% } %> diff --git a/layout/_partial/comment/gitalk.ejs b/layout/_partial/comment/gitalk.ejs index edf8c42f..4247de79 100644 --- a/layout/_partial/comment/gitalk.ejs +++ b/layout/_partial/comment/gitalk.ejs @@ -1,11 +1,11 @@ -<% if(theme.comment && theme.comment.gitalk_client_id && theme.comment.gitalk_client_secret && theme.comment.gitalk_admin && theme.comment.gitalk_owner && theme.comment.gitalk_repo) { %> +<% if (theme.comment && theme.comment.gitalk_client_id && theme.comment.gitalk_client_secret && theme.comment.gitalk_admin && theme.comment.gitalk_owner && theme.comment.gitalk_repo) { %>
- + -<% } %> \ No newline at end of file +<% } %> diff --git a/layout/_partial/comment/gitment.ejs b/layout/_partial/comment/gitment.ejs index decabe68..c40a1c55 100644 --- a/layout/_partial/comment/gitment.ejs +++ b/layout/_partial/comment/gitment.ejs @@ -1,18 +1,17 @@ -<% if(theme.comment.gitment_owner && theme.comment.gitment_repo && theme.comment.gitment_client_id && theme.comment.gitment_client_secret) { %> -
- - - -<% } %> \ No newline at end of file +<% if (theme.comment.gitment_owner && theme.comment.gitment_repo && theme.comment.gitment_client_id && theme.comment.gitment_client_secret) { %> +
+ + + +<% } %> diff --git a/layout/_partial/comment/livere.ejs b/layout/_partial/comment/livere.ejs index 4fb3b9c8..d12ee019 100644 --- a/layout/_partial/comment/livere.ejs +++ b/layout/_partial/comment/livere.ejs @@ -1,4 +1,4 @@ - + <% if(theme.comment && theme.comment.livere_uid) { %>
> - +
<% } %> - \ No newline at end of file diff --git a/layout/_partial/comment/utteranc.ejs b/layout/_partial/comment/utteranc.ejs index 4d84a272..ca9fc667 100644 --- a/layout/_partial/comment/utteranc.ejs +++ b/layout/_partial/comment/utteranc.ejs @@ -1,11 +1,11 @@ -<% if(theme.comment.utteranc_repo && theme.comment.utteranc_issue_term) { %> - -<% } %> \ No newline at end of file +<% if (theme.comment.utteranc_repo && theme.comment.utteranc_issue_term) { %> + +<% } %> diff --git a/layout/_partial/comment/valine.ejs b/layout/_partial/comment/valine.ejs index 69e75d63..8096c4ed 100644 --- a/layout/_partial/comment/valine.ejs +++ b/layout/_partial/comment/valine.ejs @@ -1,17 +1,17 @@ -<% if(theme.comment && theme.comment.valine_appId && theme.comment.valine_appKey) { %> +<% if (theme.comment && theme.comment.valine_appId && theme.comment.valine_appKey) { %>
<% } %> diff --git a/layout/_partial/comment/youyan.ejs b/layout/_partial/comment/youyan.ejs index 85eeedff..b3c2e688 100644 --- a/layout/_partial/comment/youyan.ejs +++ b/layout/_partial/comment/youyan.ejs @@ -1,5 +1,5 @@ -<% if(theme.comment && theme.comment.youyan_uid) { %> +<% if (theme.comment && theme.comment.youyan_uid) { %>
diff --git a/layout/_partial/critical-css/critical-style.ejs b/layout/_partial/critical-css/critical-style.ejs index d3a822c7..e2cfd0c3 100644 --- a/layout/_partial/critical-css/critical-style.ejs +++ b/layout/_partial/critical-css/critical-style.ejs @@ -47,5 +47,4 @@ transform: translate3d(0, 0, 0); } } - diff --git a/layout/_partial/intro-height.ejs b/layout/_partial/intro-height.ejs index 2e5daadf..89f5c15d 100644 --- a/layout/_partial/intro-height.ejs +++ b/layout/_partial/intro-height.ejs @@ -6,9 +6,9 @@ <% var aboutStrStyle = attr + ':' + String(aboutHeight) + 'vh;' %> <% var introHeightStyle %> <% if (is_home()) { %> -<%- indexStrStyle %> + <%- indexStrStyle %> <% } else if (is_post()) { %> -<%- postStrStyle %> + <%- postStrStyle %> <% } else if (page.layout === "about") { %> -<%- aboutStrStyle %> -<% } %> \ No newline at end of file + <%- aboutStrStyle %> +<% } %> diff --git a/layout/_partial/script/font-loader.ejs b/layout/_partial/script/font-loader.ejs index 6452d075..9fe62c1a 100644 --- a/layout/_partial/script/font-loader.ejs +++ b/layout/_partial/script/font-loader.ejs @@ -1,95 +1,122 @@ \ No newline at end of file + asyncLoadWithFallBack( + [ + 'https://cdn.jsdelivr.net/npm/webfontloader@1.6.28/webfontloader.min.js', + 'https://cdn.bootcss.com/webfont/1.6.28/webfontloader.js', + "<%- url_for('lib/webfontloader.min.js') %>", + ], + asyncCb, + asyncErr + ) + diff --git a/layout/_partial/sidebar/base-sidebar.ejs b/layout/_partial/sidebar/base-sidebar.ejs index 7041bc3b..6860af33 100644 --- a/layout/_partial/sidebar/base-sidebar.ejs +++ b/layout/_partial/sidebar/base-sidebar.ejs @@ -9,4 +9,4 @@ <%- partial('./sidebar-tags') %> <%- partial('./sidebar-categories') %> - \ No newline at end of file + diff --git a/layout/_partial/sidebar/sidebar-archives.ejs b/layout/_partial/sidebar/sidebar-archives.ejs index 7558262e..9949e7ad 100644 --- a/layout/_partial/sidebar/sidebar-archives.ejs +++ b/layout/_partial/sidebar/sidebar-archives.ejs @@ -1,18 +1,18 @@ - diff --git a/layout/_partial/sidebar/sidebar-categories.ejs b/layout/_partial/sidebar/sidebar-categories.ejs index 0ee1d36a..66ba6f82 100644 --- a/layout/_partial/sidebar/sidebar-categories.ejs +++ b/layout/_partial/sidebar/sidebar-categories.ejs @@ -6,4 +6,4 @@ - \ No newline at end of file + diff --git a/layout/_partial/sidebar/sidebar-tags.ejs b/layout/_partial/sidebar/sidebar-tags.ejs index 63ae4967..f091abff 100644 --- a/layout/_partial/sidebar/sidebar-tags.ejs +++ b/layout/_partial/sidebar/sidebar-tags.ejs @@ -1,35 +1,36 @@ \ No newline at end of file + diff --git a/layout/about.ejs b/layout/about.ejs index 81e85526..5c5e1827 100644 --- a/layout/about.ejs +++ b/layout/about.ejs @@ -1,6 +1,6 @@ - +
<%- page.content %>
-
\ No newline at end of file +
diff --git a/layout/index.ejs b/layout/index.ejs index df9553c8..112d06f0 100755 --- a/layout/index.ejs +++ b/layout/index.ejs @@ -1,45 +1,46 @@
<% page.posts.each(function (_post) { %> - <% let truncateLength = typeof theme.truncate_length === 'number' ? theme.truncate_length : 300 %> - <% let _content = null %> - <% if(!!_post.excerpt) { %> - <% _content = _post.excerpt %> - <% } else if (!!_post.abstract) { %> - <% _content = _post.abstract %> - <% } else { %> - <% _content = truncateLength === 0 ? null : truncate(strip_html(_post.content), {length: truncateLength, omission: '...'})%> - <% } %> -
- - <% if(_post.top) { %> - + <% let truncateLength = typeof theme.truncate_length === 'number' ? theme.truncate_length : 300 %> + <% let _content = null %> + <% if(!!_post.excerpt) { %> + <% _content = _post.excerpt %> + <% } else if (!!_post.abstract) { %> + <% _content = _post.abstract %> + <% } else { %> + <% _content = truncateLength === 0 ? null : truncate(strip_html(_post.content), {length: truncateLength, omission: '...'})%> + <% } %> +
+ + <% if(_post.top) { %> + <% } %> <%= _post.title || '[Untitled Post]' %> - -
- <%- _content %> -
-
+
<% }) %> - <% if (page.total > 1){ %> - + <% if (page.total > 1) { %> + <% } %> -
\ No newline at end of file + diff --git a/layout/layout.ejs b/layout/layout.ejs index 0eecb914..896bb10d 100755 --- a/layout/layout.ejs +++ b/layout/layout.ejs @@ -10,73 +10,86 @@ <% } else if(page.layout === "about") { %> <% } %> - <%- partial('_partial/base-header') %> - <%- partial('_partial/base-footer-fixed') %> -
- <%- partial('_partial/base-background-image') %> - <%- partial('_partial/script/font-loader') %> - -
- <%- body %> - - <% if (is_home()) { %> - <%- partial('_partial/base-profile') %> - <% } %> + + <%- partial('_partial/base-header') %> + + <%- partial('_partial/base-footer-fixed') %> + +
+ <%- partial('_partial/base-background-image') %> + <%- partial('_partial/script/font-loader') %> + +
+ <%- body %> + + <% if (is_home()) { %> + <%- partial('_partial/base-profile') %> + <% } %> +
+ <%- partial('_partial/base-footer', {}, {cache: true}) %>
- <%- partial('_partial/base-footer', {}, {cache: true}) %> -
- - <% if(is_post() && theme.toc) { %> -
- > -
- CATALOG -
- <%- toc(page.content, {class: 'toc', list_number: true}) %> -
- <% } %> - <%- partial('_partial/sidebar/base-sidebar', {}, {cache: true}) %> - <%- partial('./site-meta.ejs') %> - - - - - - <% if (theme.algolia_search.enable) { %> - <%- partial('_partial/algolia') %> - - - <% } %> - - <% if (theme.busuanzi) { %> - - <% } %> - - <% if (theme.CNZZ_analytics) { %> -
- + + + + + <% if (theme.algolia_search.enable) { %> + <%- partial('_partial/algolia') %> + + + + + + <% } %> + + <% if (theme.busuanzi) { %> + + <% } %> + + <% if (theme.CNZZ_analytics) { %> +
+ +
+ <% } %> + + <% if(is_post()) { %> + + <% } %> + + <% if (is_post() && theme.mermaid.enable) { %> + + <% } %> -
- - <% if(is_post()) { %> - - <% } %> - - diff --git a/layout/post.ejs b/layout/post.ejs index 94915699..5e4e06dd 100644 --- a/layout/post.ejs +++ b/layout/post.ejs @@ -2,7 +2,7 @@
<%- page.content %>
- + <% if(theme.copyright.enable === true && page.copyright !== false) { %>

<%- __('author') %>:<%- config.author %> @@ -12,12 +12,12 @@

版权声明:<%- theme.copyright.license %>

<% } %> - +