├── layout ├── tags.ejs ├── _partial │ ├── comment.ejs │ ├── toc.ejs │ ├── tag-list.ejs │ ├── instantclick.ejs │ ├── disqus.ejs │ ├── google-analytics.ejs │ ├── time-sec.ejs │ ├── footer.ejs │ ├── meta.ejs │ ├── favicon.ejs │ ├── list-view.ejs │ ├── math.ejs │ ├── sidebar.ejs │ ├── copyright.ejs │ ├── content-view.ejs │ ├── head.ejs │ ├── disqusjs-script.ejs │ ├── inline-style.ejs │ └── instantclick-inline.ejs ├── category.ejs ├── tag.ejs ├── page.ejs ├── post.ejs ├── archive.ejs ├── layout.ejs └── index.ejs ├── .gitignore ├── blog_demo_small.jpg ├── source ├── assets │ ├── avt_min.jpg │ ├── boat_avt3.png │ ├── b_pattern_small.jpg │ ├── translate_icon.svg │ ├── rss.svg │ ├── github.svg │ └── by-nc-nd.svg ├── favicons │ ├── favicon.ico │ ├── favicon-16x16.png │ ├── favicon-32x32.png │ ├── apple-touch-icon.png │ ├── android-chrome-192x192.png │ ├── android-chrome-512x512.png │ └── site.webmanifest ├── css │ ├── defer-style.styl │ ├── github.css │ ├── style.styl │ ├── _partial │ │ ├── time-sec.styl │ │ ├── part-github.styl │ │ ├── trans.styl │ │ ├── mathjax-svg.styl │ │ ├── sidebar.styl │ │ ├── post.styl │ │ └── layout.styl │ ├── normalize.min.css │ └── disqusjs.css └── js │ ├── instantclick.min.js.map │ ├── instantclick.min.js │ └── disqus.js ├── .gitmodules ├── languages ├── default.yml └── en.yml ├── LICENSE ├── README.md ├── scripts └── helpers │ └── inline-css.js └── _config.yml /layout/tags.ejs: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /layout/_partial/comment.ejs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | source/CNAME 2 | .DS_Store 3 | -------------------------------------------------------------------------------- /layout/category.ejs: -------------------------------------------------------------------------------- 1 | <%- partial('index') %> -------------------------------------------------------------------------------- /layout/tag.ejs: -------------------------------------------------------------------------------- 1 | <%- partial('index') %> 2 | -------------------------------------------------------------------------------- /blog_demo_small.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/renzibei/hexo-theme-icalm/master/blog_demo_small.jpg -------------------------------------------------------------------------------- /layout/page.ejs: -------------------------------------------------------------------------------- 1 |
2 | <%- partial('_partial/content-view', { post: page, isPage: true }) %> 3 |
4 | -------------------------------------------------------------------------------- /source/assets/avt_min.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/renzibei/hexo-theme-icalm/master/source/assets/avt_min.jpg -------------------------------------------------------------------------------- /source/assets/boat_avt3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/renzibei/hexo-theme-icalm/master/source/assets/boat_avt3.png -------------------------------------------------------------------------------- /source/favicons/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/renzibei/hexo-theme-icalm/master/source/favicons/favicon.ico -------------------------------------------------------------------------------- /source/assets/b_pattern_small.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/renzibei/hexo-theme-icalm/master/source/assets/b_pattern_small.jpg -------------------------------------------------------------------------------- /source/css/defer-style.styl: -------------------------------------------------------------------------------- 1 | @import "_partial/trans" 2 | @import "_partial/part-github.styl" 3 | @import "_partial/mathjax-svg.styl" -------------------------------------------------------------------------------- /source/favicons/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/renzibei/hexo-theme-icalm/master/source/favicons/favicon-16x16.png -------------------------------------------------------------------------------- /source/favicons/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/renzibei/hexo-theme-icalm/master/source/favicons/favicon-32x32.png -------------------------------------------------------------------------------- /source/js/instantclick.min.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"instantclick.min.js","sources":[],"sourcesContent":[],"names":[],"mappings":""} -------------------------------------------------------------------------------- /source/favicons/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/renzibei/hexo-theme-icalm/master/source/favicons/apple-touch-icon.png -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "source/assets/normalize"] 2 | path = source/css/normalize 3 | url = https://github.com/necolas/normalize.css.git 4 | -------------------------------------------------------------------------------- /source/favicons/android-chrome-192x192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/renzibei/hexo-theme-icalm/master/source/favicons/android-chrome-192x192.png -------------------------------------------------------------------------------- /source/favicons/android-chrome-512x512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/renzibei/hexo-theme-icalm/master/source/favicons/android-chrome-512x512.png -------------------------------------------------------------------------------- /layout/post.ejs: -------------------------------------------------------------------------------- 1 |
2 | <%- partial('_partial/content-view', { post: page, isPage: false }) %> 3 | <%- partial('_partial/comment') %> 4 |
5 | -------------------------------------------------------------------------------- /layout/_partial/toc.ejs: -------------------------------------------------------------------------------- 1 | <% if (post.toc == true) { %> 2 |
3 | <%- toc(post.content, {list_number: false}) %> 4 |
5 | <% } %> -------------------------------------------------------------------------------- /source/css/github.css: -------------------------------------------------------------------------------- 1 | 2 | .title, 3 | .attr, 4 | .selector-id, 5 | .selector-class, 6 | .selector-attr, 7 | .selector-pseudo { 8 | color: #795da3 9 | } 10 | 11 | -------------------------------------------------------------------------------- /layout/_partial/tag-list.ejs: -------------------------------------------------------------------------------- 1 | <% tags.each(tag => { %> 2 |
  • 3 | { <%= tag.name %> } 4 |
  • 5 | <% }) %> 6 | -------------------------------------------------------------------------------- /source/css/style.styl: -------------------------------------------------------------------------------- 1 | 2 | 3 | @import "_partial/layout" 4 | @import "_partial/sidebar" 5 | @import "_partial/post" 6 | @import "_partial/time-sec" 7 | 8 | @import "github.css" 9 | -------------------------------------------------------------------------------- /languages/default.yml: -------------------------------------------------------------------------------- 1 | copyright: 2 | author: "作者: " 3 | link: "文章链接: " 4 | license_title: "版权声明: " 5 | left_license_content: "本网站所有文章(包含文字、图片等内容)除特别声明外,均系作者原创,采用 " 6 | right_license_content: "许可协议。引用与转载时请遵守协议、注明出处。" 7 | 8 | post_in_date: "发布于" -------------------------------------------------------------------------------- /layout/_partial/instantclick.ejs: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /source/favicons/site.webmanifest: -------------------------------------------------------------------------------- 1 | {"name":"","short_name":"","icons":[{"src":"/favicons/android-chrome-192x192.png","sizes":"192x192","type":"image/png"},{"src":"/favicons/android-chrome-512x512.png","sizes":"512x512","type":"image/png"}],"theme_color":"#ffffff","background_color":"#ffffff","display":"standalone"} -------------------------------------------------------------------------------- /source/css/_partial/time-sec.styl: -------------------------------------------------------------------------------- 1 | /** 2 | time sec begin 3 | */ 4 | 5 | $trans_time = 500ms 6 | 7 | .TimeSection 8 | overflow: hidden 9 | h1 10 | cursor: pointer 11 | ul 12 | margin: 0 13 | padding: 0 14 | overflow: hidden 15 | // transition: opacity 500ms ease-out -------------------------------------------------------------------------------- /languages/en.yml: -------------------------------------------------------------------------------- 1 | copyright: 2 | author: "Author: " 3 | link: "Link: " 4 | license_title: "Copyright Notice: " 5 | left_license_content: "All articles on this website, unless otherwise stated, are created by the author and are licensed under" 6 | right_license_content: " License. Please observe the agreement and cite the source when quoting and reproducing." 7 | 8 | post_in_date: "post in" -------------------------------------------------------------------------------- /layout/archive.ejs: -------------------------------------------------------------------------------- 1 |
    2 | <% let years = {}; %> 3 | <% 4 | site.posts.each(post => { 5 | const y = post.date.year(); 6 | if (!years[y]) years[y] = []; 7 | years[y].push(post); 8 | }) 9 | %> 10 | <% for (const y of Object.keys(years).reverse()) { %> 11 | 12 | <%- partial('_partial/time-sec', { year: y, posts: years[y].reverse() }) %> 13 | <% } %> 14 |
    -------------------------------------------------------------------------------- /layout/_partial/disqus.ejs: -------------------------------------------------------------------------------- 1 | <% if (theme.disqus.enable === 'all' || (theme.disqus.enable === 'post' && !isPage)) { %> 2 |
    3 |
    4 |
    5 | <% } %> 6 | 7 | <% if (theme.disqusjs.enable === 'all' || (theme.disqusjs.enable === 'post' && !isPage)) { %> 8 |
    9 |
    10 | 11 | <%- partial('_partial/disqusjs-script.ejs') %> 12 |
    13 | <% } %> -------------------------------------------------------------------------------- /source/assets/translate_icon.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /layout/layout.ejs: -------------------------------------------------------------------------------- 1 | 2 | 3 | <%- partial('_partial/head') %> 4 | 5 | 6 |
    7 | <%- partial('_partial/sidebar') %> 8 |
    9 |
    10 | <%- body %> 11 | <%- partial('_partial/footer') %> 12 |
    13 |
    14 |
    15 | 16 | <%- partial('_partial/instantclick') %> 17 | <%- partial('_partial/google-analytics') %> 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /layout/_partial/google-analytics.ejs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 10 | 11 | -------------------------------------------------------------------------------- /layout/_partial/time-sec.ejs: -------------------------------------------------------------------------------- 1 |
    2 |

    3 | <%= year %> 4 |

    5 | 16 |
    17 | -------------------------------------------------------------------------------- /layout/_partial/footer.ejs: -------------------------------------------------------------------------------- 1 | 13 | -------------------------------------------------------------------------------- /layout/_partial/meta.ejs: -------------------------------------------------------------------------------- 1 |
    2 | 5 | <% if (post.tags && post.tags.length){ %> 6 | | 7 | 10 | <% } %> 11 | <% if (post.categories && post.categories.length){ %> 12 | / 13 | 16 | <% } %> 17 |
    18 | -------------------------------------------------------------------------------- /layout/index.ejs: -------------------------------------------------------------------------------- 1 | 13 | <% if (page.total > 1){ %> 14 | 22 | <% } %> 23 | -------------------------------------------------------------------------------- /source/assets/rss.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /layout/_partial/favicon.ejs: -------------------------------------------------------------------------------- 1 | <% if (theme.favicon) { %> 2 | <% if (theme.favicon.ico) { %> 3 | 4 | <% } %> 5 | <% if (theme.favicon.icon180px) { %> 6 | 7 | <% } %> 8 | <% if (theme.favicon.icon32px) { %> 9 | 10 | <% } %> 11 | <% if (theme.favicon.icon16px) { %> 12 | 13 | <% } %> 14 | <% if (theme.favicon.manifest) { %> 15 | 16 | <% } %> 17 | <% } %> -------------------------------------------------------------------------------- /layout/_partial/list-view.ejs: -------------------------------------------------------------------------------- 1 |
    2 |
    3 | <% if (post.link){ %> 4 |

    5 | <%= post.title %> 6 |

    7 | <% } else if (post.title){ %> 8 |

    9 | <%= post.title %> 10 |

    11 | <% } %> 12 | <%- partial('meta', { post: post }) %> 13 |
    14 |
    15 | <% if (post.excerpt){ %> 16 | <%- post.excerpt %> 17 | <% if (theme.excerpt_link){ %> 18 | 21 | <% } %> 22 | <% } else { %> 23 | <%- post.content %> 24 | <% } %> 25 |
    26 |
    27 | -------------------------------------------------------------------------------- /source/css/_partial/part-github.styl: -------------------------------------------------------------------------------- 1 | .hljs { 2 | display: block; 3 | background: white; 4 | padding: 0.5em; 5 | color: #333333; 6 | overflow-x: auto 7 | } 8 | 9 | .comment, 10 | .meta { 11 | color: #969896 12 | } 13 | 14 | .string, 15 | .variable, 16 | .template-variable, 17 | .strong, 18 | .emphasis, 19 | .quote { 20 | color: #df5000 21 | } 22 | 23 | .keyword, 24 | .selector-tag, 25 | .type { 26 | color: #a71d5d 27 | } 28 | 29 | .literal, 30 | .symbol, 31 | .bullet, 32 | .attribute { 33 | color: #0086b3 34 | } 35 | 36 | .section, 37 | .name { 38 | color: #63a35c 39 | } 40 | 41 | .tag { 42 | color: #333333 43 | } 44 | 45 | .addition { 46 | color: #55a532; 47 | background-color: #eaffea 48 | } 49 | 50 | .deletion { 51 | color: #bd2c00; 52 | background-color: #ffecec 53 | } 54 | 55 | .link { 56 | text-decoration: underline 57 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /layout/_partial/math.ejs: -------------------------------------------------------------------------------- 1 | <% if (theme.math.enable) { %> 2 | <% if (page.math || theme.math.all_pages) { %> 3 | 4 | <% if (theme.mathEngine == 'mathjax') { %> 5 | 6 | 15 | 23 | <% } %> 24 | 25 | <% if (theme.mathEngine == 'katex') { %> 26 | 27 | 28 | <% } %> 29 | 30 | <% } %> 31 | <% } %> -------------------------------------------------------------------------------- /layout/_partial/sidebar.ejs: -------------------------------------------------------------------------------- 1 | 30 | -------------------------------------------------------------------------------- /source/css/_partial/trans.styl: -------------------------------------------------------------------------------- 1 | fill-full(l, r) 2 | position: absolute 3 | left: l 4 | right: r 5 | 6 | 7 | .route-trans-enter 8 | fill-full(0, 0) 9 | transform: translateX(-100px) 10 | opacity: 0 11 | 12 | .route-trans-enter.route-trans-enter-active 13 | animation: route-trans-e 0.8s 14 | animation-fill-mode: forwards 15 | 16 | 17 | .route-trans-leave 18 | fill-full(0, 0) 19 | transform: translateX(0) 20 | opacity: 1 21 | 22 | .route-trans-leave.route-trans-leave-active 23 | animation: route-trans-o 0.8s 24 | animation-fill-mode: forwards 25 | 26 | @keyframes route-trans-e 27 | 0% 28 | transform: translate3d(-100px, 0, 0) 29 | opacity: 0 30 | 50% 31 | transform: translate3d(-100px, 0, 0) 32 | opacity: 0 33 | 100% 34 | transform: translate3d(0, 0, 0) 35 | opacity: 1 36 | 37 | @keyframes route-trans-o 38 | 0% 39 | transform: translate3d(0, 0, 0) 40 | opacity: 1 41 | 50% 42 | transform: translate3d(100px, 0, 0) 43 | opacity: 0 44 | 100% 45 | transform: translate3d(100px, 0, 0) 46 | opacity: 0 -------------------------------------------------------------------------------- /layout/_partial/copyright.ejs: -------------------------------------------------------------------------------- 1 |
    2 | <% if (theme.copyright.enable) { %> 3 | 20 | <% } %> 21 |
    22 | -------------------------------------------------------------------------------- /source/assets/github.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /layout/_partial/content-view.ejs: -------------------------------------------------------------------------------- 1 |
    2 |
    3 |

    <%= post.title %>

    4 |
    5 | 6 |
    7 | <%- partial('toc') %> 8 | 9 | <%- post.content %> 10 | 11 | <% if (post.type === 'tags') { %> 12 |
      13 | <%- partial('_partial/tag-list', { className: 'tag-list', tags: site.tags }) %> 14 |
    15 | <% } else if (post.type === 'categories') { %> 16 |
      17 | <%- partial('_partial/tag-list', { className: 'tag-list', tags: site.categories }) %> 18 |
    19 | <% } %> 20 | 21 |
    22 | <% if (!isPage) { %> 23 | <%- partial('_partial/copyright') %> 24 | 37 | <% } %> 38 | 39 | <%- partial('_partial/disqus') %> 40 |
    41 | -------------------------------------------------------------------------------- /layout/_partial/head.ejs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | <% if (page.title){ %><%= page.title %> | <% } %><%= config.title %> 6 | 7 | <%- partial("_partial/favicon") %> 8 | 9 | <% if (theme.source_han_font) { %> 10 | <% } %> 11 | 12 | <%- inline_css("themes/hexo-theme-icalm/source/css/style.styl") %> 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Icalm 2 | 3 | ![icalm](./blog_demo_small.jpg) 4 | 5 | 6 | 7 | [Live example](https://renzibei.com) 8 | 9 | ## Browser Support 10 | 11 | Latest versions of modern browsers for ES2015+ support. 12 | 13 | Basic style support for outdated browsers. 14 | 15 | Use [InstantClick](instantclick.io) for fast loading. 16 | 17 | ## Installation 18 | 19 | ``` 20 | git clone https://github.com/renzibei/hexo-theme-icalm.git themes/hexo-theme-icalm 21 | npm install hexo-cdn-jsdelivr 22 | cd themes/hexo-theme-icalm/ 23 | git submodule update --init --recursive 24 | ``` 25 | 26 | update 27 | 28 | ``` 29 | git pull && git submodule update --remote 30 | ``` 31 | 32 | ## Customize 33 | 34 | Edit `_config.yml`. 35 | 36 | You can add support for 37 | 38 | - social media like github, facebook 39 | - RSS 40 | - Latex with pandoc and [hexo-filter-mathjax](https://github.com/next-theme/hexo-filter-mathjax) 41 | 42 | ## Tags or Categories Page 43 | 44 | Run `hexo n page "tags"` or `hexo n page "categories"` 45 | 46 | Then edit the generated .md file, set the `type` to `tags` or `categories`. 47 | 48 | ## Speed up loading static assets with jsDelivr CDN 49 | 50 | Now you can use `hexo-cdn-jsdelivr` to speed up the loading of static assets like images. You can check it in its [Github repo](https://github.com/renzibei/hexo-cdn-jsdelivr). 51 | 52 | You may have to install it to avoid some of the errors in template files. 53 | 54 | ## TODO List 55 | 56 | - [ ] Remove unnecessary katex css loading 57 | 58 | - [x] Make static assets CDN more automatic 59 | 60 | ## Add License 61 | 62 | To add license information to website footer, just add a `license` entry to hexo's `_config.yml`. 63 | 64 | ## LICENSE 65 | 66 | MIT 67 | -------------------------------------------------------------------------------- /source/css/normalize.min.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Minified by jsDelivr using clean-css v4.2.1. 3 | * Original file: /npm/normalize.css@8.0.1/normalize.css 4 | * 5 | * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files 6 | */ 7 | /*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */ 8 | html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}main{display:block}h1{font-size:2em;margin:.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none} 9 | /*# sourceMappingURL=/sm/5d8a97cdb40a6c49031b52d63494a6eca084416b5b035e5698fdc5fa0969b2c3.map */ -------------------------------------------------------------------------------- /layout/_partial/disqusjs-script.ejs: -------------------------------------------------------------------------------- 1 | <% if (theme.disqusjs.enable === 'all' || (theme.disqusjs.enable === 'post' && !isPage)) { %> 2 | 24 | 25 | 26 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | <% } %> -------------------------------------------------------------------------------- /scripts/helpers/inline-css.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | 4 | const stylus = require('stylus'); 5 | const fs = require('fs'); 6 | const pathFn = require('path'); 7 | 8 | function getProperty(obj, name) { 9 | name = name.replace(/\[(\w+)\]/g, '.$1').replace(/^\./, ''); 10 | 11 | const split = name.split('.'); 12 | let key = split.shift(); 13 | 14 | if (!Object.prototype.hasOwnProperty.call(obj, key)) return ''; 15 | 16 | let result = obj[key]; 17 | const len = split.length; 18 | 19 | if (!len) return result || ''; 20 | if (typeof result !== 'object') return ''; 21 | 22 | for (let i = 0; i < len; i++) { 23 | key = split[i]; 24 | if (!Object.prototype.hasOwnProperty.call(result, key)) return ''; 25 | 26 | result = result[split[i]]; 27 | if (typeof result !== 'object') return result; 28 | } 29 | 30 | return result; 31 | } 32 | 33 | function applyPlugins(stylusConfig, plugins) { 34 | plugins.forEach(plugin => { 35 | const factoryFn = require(plugin.trim()); 36 | stylusConfig.use(factoryFn()); 37 | }); 38 | } 39 | 40 | hexo.extend.helper.register('inline_css', function(path){ 41 | const tempPath = path; 42 | const config = hexo.config.stylus || {}; 43 | 44 | const baseDirPath = hexo.base_dir; 45 | const filePath = pathFn.join(baseDirPath, tempPath); 46 | const fileExtName = pathFn.extname(filePath); 47 | let fileContent = fs.readFileSync(filePath, 'utf8'); 48 | if (fileExtName === ".css") { 49 | return ""; 50 | } 51 | else if(fileExtName === ".styl" || fileExtName === ".stylus"){ 52 | const self = hexo; 53 | const plugins = ['nib'].concat(config.plugins || []); 54 | 55 | function defineConfig(style) { 56 | style.define('hexo-config', data => { 57 | return getProperty(self.theme.config, data.val); 58 | }); 59 | } 60 | 61 | const stylusConfig = stylus(fileContent); 62 | applyPlugins(stylusConfig, plugins); 63 | 64 | return ""; 71 | } 72 | }); 73 | -------------------------------------------------------------------------------- /source/css/_partial/mathjax-svg.styl: -------------------------------------------------------------------------------- 1 | 2 | mjx-container[jax="SVG"] { 3 | direction: ltr; 4 | } 5 | 6 | mjx-container[jax="SVG"] > svg { 7 | overflow: visible; 8 | } 9 | 10 | mjx-container[jax="SVG"] > svg a { 11 | fill: blue; 12 | stroke: blue; 13 | } 14 | 15 | mjx-container[jax="SVG"][display="true"] { 16 | display: block; 17 | text-align: center; 18 | margin: 1em 0; 19 | } 20 | 21 | mjx-container[jax="SVG"][justify="left"] { 22 | text-align: left; 23 | } 24 | 25 | mjx-container[jax="SVG"][justify="right"] { 26 | text-align: right; 27 | } 28 | 29 | g[data-mml-node="merror"] > g { 30 | fill: red; 31 | stroke: red; 32 | } 33 | 34 | g[data-mml-node="merror"] > rect[data-background] { 35 | fill: yellow; 36 | stroke: none; 37 | } 38 | 39 | g[data-mml-node="mtable"] > line[data-line] { 40 | stroke-width: 70px; 41 | fill: none; 42 | } 43 | 44 | g[data-mml-node="mtable"] > rect[data-frame] { 45 | stroke-width: 70px; 46 | fill: none; 47 | } 48 | 49 | g[data-mml-node="mtable"] > .mjx-dashed { 50 | stroke-dasharray: 140; 51 | } 52 | 53 | g[data-mml-node="mtable"] > .mjx-dotted { 54 | stroke-linecap: round; 55 | stroke-dasharray: 0,140; 56 | } 57 | 58 | g[data-mml-node="mtable"] > svg { 59 | overflow: visible; 60 | } 61 | 62 | [jax="SVG"] mjx-tool { 63 | display: inline-block; 64 | position: relative; 65 | width: 0; 66 | height: 0; 67 | } 68 | 69 | [jax="SVG"] mjx-tool > mjx-tip { 70 | position: absolute; 71 | top: 0; 72 | left: 0; 73 | } 74 | 75 | mjx-tool > mjx-tip { 76 | display: inline-block; 77 | padding: .2em; 78 | border: 1px solid #888; 79 | font-size: 70%; 80 | background-color: #F8F8F8; 81 | color: black; 82 | box-shadow: 2px 2px 5px #AAAAAA; 83 | } 84 | 85 | g[data-mml-node="maction"][data-toggle] { 86 | cursor: pointer; 87 | } 88 | 89 | mjx-status { 90 | display: block; 91 | position: fixed; 92 | left: 1em; 93 | bottom: 1em; 94 | min-width: 25%; 95 | padding: .2em .4em; 96 | border: 1px solid #888; 97 | font-size: 90%; 98 | background-color: #F8F8F8; 99 | color: black; 100 | } 101 | 102 | foreignObject[data-mjx-xml] { 103 | font-family: initial; 104 | line-height: normal; 105 | overflow: visible; 106 | } 107 | 108 | .MathJax path { 109 | stroke-width: 3; 110 | } 111 | 112 | mjx-container[display="true"] { 113 | overflow: auto hidden; 114 | } 115 | 116 | mjx-container[display="true"] + br { 117 | display: none; 118 | } 119 | -------------------------------------------------------------------------------- /_config.yml: -------------------------------------------------------------------------------- 1 | # Links on sidebar 2 | menu: 3 | Home: / 4 | Categories: /categories/ 5 | Archive: /archives/ 6 | Tags: /tags/ 7 | About: /about/ 8 | 9 | # Pictures shown on the sidebar 10 | # Use the absolute URL after generating 11 | # avatar: https://cdn.jsdelivr.net/gh/renzibei/blog-asset-images/theme-assets/avt_min.jpg 12 | avatar: /assets/boat_avt3.png 13 | # sidebar_background: https://cdn.jsdelivr.net/gh/renzibei/blog-asset-images/theme-assets/b_pattern_small.jpg 14 | sidebar_background: /assets/b_pattern_small.jpg 15 | 16 | rss: /atom.xml 17 | 18 | # Content 19 | excerpt_link: Read On » 20 | 21 | # Will be shown on the bottom. 22 | ## To add new icon, just copy .svg to source/assets/ and add entries below. 23 | media: 24 | chinese: /en/ 25 | github: https://github.com/renzibei 26 | # facebook: https://www.facebook.com/profile.php?id=100004252391322 27 | rss: /atom.xml 28 | 29 | media_icon: 30 | chinese: /assets/translate_icon.svg 31 | github: /assets/github.svg 32 | rss: /assets/rss.svg 33 | 34 | source_han_font: true 35 | 36 | # Disqus settings 37 | disqus: 38 | # 'disabled' | 'all' | 'post' 39 | enable: 'disabled' 40 | # Shortname of your disqus website. 41 | # See disqus admin 42 | shortname: renzibei-test 43 | 44 | disqusjs: 45 | enable: 'post' 46 | sitename: renzibei.com 47 | # api: https://disqus.com/api/ 48 | api: https://disqus.renzibei.com/api/ 49 | shortname: renzibei-site 50 | # shortname: renzibei-test 51 | apikey: vIVSVvMh0L9v1kip6Yft6JinP4EG0COwNyCjaLJ850cadxrdHfJLF9rMzxUk51PD 52 | nocomment: 花径不曾缘客扫,蓬门今始为君开。 53 | 54 | # If you want to add support for Latex, use hexo-filter-mathjax, https://github.com/next-theme/hexo-filter-mathjax 55 | 56 | # Below is deprecated, install hexo-filter-mathjax instead 57 | # Math, Just use this to load katex css now, helping offline render 58 | # mathEngine: 'katex' # or 'katex 'mathjax'' 59 | # math: 60 | # enable: false 61 | # all_pages: false 62 | # mathjax: 63 | # src: https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML 64 | # katex: 65 | # src: 66 | # css: https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/katex.min.css 67 | # js: https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/katex.min.js 68 | # autorender: https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/contrib/auto-render.min.js 69 | 70 | # Miscellaneous 71 | google_analytics_id: UA-168746624-1 72 | 73 | favicon: 74 | icon180px: /favicons/apple-touch-icon.png 75 | icon32px: /favicons/favicon-32x32.png 76 | icon16px: /favicons/favicon-16x16.png 77 | manifest: /favicons/site.webmanifest 78 | 79 | 80 | copyright: 81 | enable: true 82 | license_title: CC BY-NC-ND 4.0 83 | license_url: https://creativecommons.org/licenses/by-nc-nd/4.0/ 84 | license_icon: /assets/by-nc-nd.svg 85 | -------------------------------------------------------------------------------- /source/css/_partial/sidebar.styl: -------------------------------------------------------------------------------- 1 | /** 2 | sidebar begin 3 | */ 4 | 5 | $header_width = 240px 6 | $header_height = 180px 7 | $av_size = 130px 8 | 9 | .SideBar 10 | position: fixed 11 | width: $header_width 12 | overflow: hidden 13 | top: 0 14 | left: 0 15 | bottom: 0 16 | height: 100% 17 | position: fixed 18 | background-color: #FFFFFF 19 | z-index: 10000 20 | > section 21 | width 100% 22 | .media 23 | position: absolute 24 | width: 100% 25 | bottom: 0.5rem 26 | text-align: right 27 | > a 28 | margin-left: 1em 29 | border: none 30 | img 31 | width: 1.5em 32 | height: auto 33 | opacity: 0.6 34 | &:hover 35 | opacity: 1 36 | .menu 37 | box-sizing: border-box 38 | position: absolute 39 | top: $header_height + 60px 40 | width: $header_width 41 | margin: 0 42 | text-align: right 43 | line-height: 1.7em 44 | > ul 45 | padding-top: 2em 46 | 47 | .avatar 48 | height: $header_height 49 | background-color: #333 50 | // background-image: url(../../assets/header.png) 51 | position: absolute 52 | width: 100% 53 | top: 0 54 | .av-pic 55 | display: block 56 | width: $av_size 57 | height: $av_size 58 | margin-top: ($header_height - ($av_size / 2)) 59 | margin-left: auto 60 | margin-right: auto 61 | border-radius: 50% 62 | background-color: #FFFFFF 63 | // background-image: url(../../assets/tree_small.png) 64 | background-size: 100% 65 | 66 | .Btn 67 | border-bottom: none 68 | > li 69 | list-style: none 70 | line-height: 1em 71 | margin: 2rem 0 72 | 73 | @media screen and (min-width: 1024px) 74 | a.Btn 75 | border-bottom: none 76 | > li 77 | padding-right: 1em 78 | border-right: 3px #aaa solid 79 | &:hover 80 | border-right-color: #333 81 | &.active > li 82 | border-right-color: #333 83 | 84 | @media screen and (max-width: 1024px) 85 | .SideBar 86 | position: absolute 87 | left: 0 88 | right: 0 89 | height: 10em 90 | width: auto 91 | overflow: visible 92 | .menu 93 | position: relative 94 | top: ($header_height / 1.5 + ($av_size / 2)) 95 | text-align: center 96 | width: 100% 97 | > ul 98 | display: flex 99 | align-items: center 100 | justify-content: center 101 | width: 50% 102 | min-width: 280px 103 | margin: 0 auto 104 | padding: 0 105 | .Btn > li 106 | margin: 1em 0 107 | padding: 0 108 | flex: 1 109 | border-right: none 110 | min-width: 70px 111 | .media 112 | bottom: -2.5em 113 | right: 1.5em 114 | .avatar 115 | height: ($header_height / 1.5) 116 | > .av-pic 117 | margin-top: ($header_height / 1.5 - ($av_size / 2)) 118 | -------------------------------------------------------------------------------- /source/css/_partial/post.styl: -------------------------------------------------------------------------------- 1 | /** 2 | post begin 3 | */ 4 | 5 | .ListView 6 | margin-bottom: 7em 7 | .title 8 | text-align: center 9 | h1 10 | font-size: 1.8rem 11 | font-weight: 400 12 | margin-bottom: 0.3em 13 | line-height: 125% 14 | a 15 | border-bottom: none 16 | color: #111 17 | &:hover 18 | color: #0e0e0e 19 | border-bottom: 1px #0e0e0e solid 20 | .ListMeta 21 | font-size: 0.8em 22 | color: #bbb 23 | margin-bottom: 2.5em 24 | &:hover 25 | color: #333 26 | ul 27 | display: inline 28 | padding: 0 29 | li.meta-text 30 | display: inline-block 31 | .more-link 32 | a 33 | border-bottom-width: 2px 34 | 35 | .PageTitle 36 | text-align: left 37 | margin-bottom: 4em 38 | h1 39 | font-size: 2rem 40 | font-weight: 400 41 | margin-bottom: 0.3em 42 | margin-left: -10% 43 | @media screen and (max-width: 1024px) 44 | font-size: 2rem 45 | margin-left: auto 46 | padding-top: 3rem 47 | a 48 | border: none 49 | color: #111 50 | time 51 | font-family: inherit 52 | 53 | .ContentView 54 | padding-top: 4em 55 | 56 | table 57 | //border: 1px solid grey 58 | border: none 59 | margin-top: 30px 60 | margin-bottom: 30px 61 | margin-left: auto 62 | margin-right: auto 63 | border-collapse: collapse 64 | border-spacing: 0 65 | border-image-width: 0 66 | padding 0 67 | 68 | th 69 | border: 1px solid grey 70 | // border: none 71 | padding-left: 13px 72 | padding-right: 13px 73 | padding-top: 6px 74 | padding-bottom: 6px 75 | border-collapse: collapse 76 | border-image-width: 0 77 | border-spacing: 0 78 | 79 | td 80 | border: 1px solid grey 81 | //border: none 82 | border-collapse: collapse 83 | border-image-width: 0 84 | border-spacing: 0 85 | padding 0 1em 86 | 87 | 88 | 89 | img 90 | display: block 91 | margin: 0 auto 92 | 93 | .ArticleMeta 94 | font-size: 0.8em 95 | color: #bbb 96 | margin: 2.5em auto 97 | a 98 | border-bottom: 1px #bbb solid 99 | &:hover 100 | color: #333 101 | a 102 | border-bottom: 1px #333 solid 103 | 104 | > div:nth-child(1) 105 | position: relative 106 | width: 49% 107 | text-align: right 108 | &::after 109 | content: '/' 110 | font-size: 300% 111 | font-weight: 100 112 | position: absolute 113 | top: 15px 114 | right: -18px 115 | > div:nth-child(2) 116 | width: 49% 117 | margin-left: auto 118 | margin-right: 0 119 | > div:only-child 120 | width: 100% 121 | text-align: center 122 | &::after 123 | display: none 124 | #nav-wrapper 125 | text-align: center 126 | #page-nav 127 | position: relative 128 | display: inline-block 129 | padding: 0 1em 130 | .page-number 131 | margin: 0.3em 132 | 133 | .post-copyright { 134 | margin: 2em 0 0; 135 | padding: 0.5em 1em; 136 | background-color: #EDEDED 137 | border-left: 3px solid #4a4a4a; 138 | list-style: none; 139 | } 140 | 141 | .post-copyright li { 142 | line-height: 27px; 143 | } 144 | 145 | .extend 146 | border-bottom-color: transparent 147 | line-height: inherit 148 | position: absolute 149 | white-space: nowrap 150 | 151 | &.prev 152 | right: 100% 153 | 154 | &.next 155 | left: 100% 156 | -------------------------------------------------------------------------------- /source/css/_partial/layout.styl: -------------------------------------------------------------------------------- 1 | /** 2 | layout begin 3 | */ 4 | 5 | $link_color_d = rgb(104, 104, 104) 6 | $link_color_h = rgb(14, 14, 14) 7 | 8 | $text-color = rgb(74, 74, 74) 9 | $text-muted-color = rgb(204, 204, 204) 10 | 11 | fill-full(l, r) 12 | position: absolute 13 | left: l 14 | right: r 15 | 16 | body 17 | font-family: "Source Han Serif", "PingFang SC", "Microsoft YaHei", sans-serif 18 | // font-weight: 300 19 | line-height: 1.7em 20 | color: $text-color 21 | overflow-x: hidden 22 | 23 | a 24 | text-decoration: none 25 | color: $link_color_d 26 | border-bottom: 1px $link_color_d solid 27 | &:hover 28 | color: $link_color_h 29 | border-bottom: 1px $link_color_h solid 30 | 31 | .gutter 32 | text-align: right 33 | width: 2em 34 | 35 | 36 | figure.highlight 37 | display: block 38 | // width: 92% 39 | margin: auto 40 | overflow-x: auto 41 | 42 | 43 | .highlight > table 44 | width: 100% 45 | padding: 0 46 | 47 | .highlight 48 | td.gutter, td.code 49 | padding: 0 50 | border: 0 51 | td.gutter 52 | border-right: 1px solid gray 53 | figure.highlight 54 | table 55 | border: 0 56 | margin-top: auto 57 | margin-bottom: auto 58 | 59 | code 60 | background: #eee 61 | padding: 1px 0.4em 62 | 63 | figure.highlight, .code, code 64 | font-family: Monaco, Menlo, Consolas, 'Microsoft Yahei', monospace 65 | font-size: 13px 66 | margin: auto 5px 67 | border: 0 68 | 69 | pre 70 | //width: 98% 71 | margin: auto 72 | overflow-x: auto 73 | font-family: inherit 74 | font-size: 13px 75 | background: #eee 76 | line-height: 1.6em 77 | border: 0 78 | 79 | .highlight 80 | .gutter pre 81 | padding: 0.5em 0.5em 82 | background: #eff2f3 83 | .code pre 84 | padding: 0.5em 1em 85 | background: #f7f7f7 86 | 87 | img 88 | max-width: 100% 89 | 90 | sup 91 | a 92 | border-bottom: none 93 | 94 | blockquote 95 | margin: 1em 0 96 | padding: 0 40px 97 | box-sizing: border-box 98 | border-left: 2px solid $text-color 99 | 100 | .container 101 | box-sizing: border-box 102 | fill-full(240px, 0) 103 | margin: auto 104 | max-width: 1320px 105 | width: 60% 106 | .container 107 | > div 108 | > footer 109 | width: 100% 110 | text-align: center 111 | color: $text-muted-color 112 | font-size: 14px 113 | line-height: 20px 114 | padding: 5rem 0 2rem 115 | a 116 | color: $text-muted-color 117 | border-color: $text-muted-color 118 | &:hover 119 | color: darken($text-muted-color, 50%) 120 | border-color: darken($text-muted-color, 50%) 121 | 122 | .Index, .TagArticle 123 | padding: 7em 0 0 0 124 | margin: 0 125 | > li 126 | list-style: none 127 | 128 | .Archives 129 | $side_padding = 16px 130 | $line_posi = -2px 131 | $line_width = 2px 132 | $cir_width_b = 10px 133 | $cir_width_sm = $cir_width_b * 0.8 134 | position: relative 135 | padding: 7em $side_padding 0 136 | 137 | &::before 138 | position: absolute 139 | top: 0 140 | bottom: 0 141 | left: $line_posi 142 | height: auto 143 | content: '' 144 | background-color: #ddd 145 | width: $line_width 146 | 147 | h1, h2 148 | font-weight: 400 149 | &::before 150 | position: absolute 151 | left: ($line_posi - $cir_width_b / 2 + $line_width / 2) 152 | content: '' 153 | background-color: #ddd 154 | width: $cir_width_b 155 | height: $cir_width_b 156 | border-radius: 50% 157 | margin-top: $cir_width_b * 0.7 158 | &:hover::before 159 | background-color: #777 160 | transition: background-color 500ms ease 161 | h2 162 | font-size: 1.3rem 163 | margin-bottom: 0 164 | &::before 165 | left: ($line_posi - $cir_width_sm / 2 + $line_width / 2) 166 | margin-top: $cir_width_sm 167 | width: $cir_width_sm 168 | height: $cir_width_sm 169 | 170 | .Tags 171 | margin: 0 172 | padding: 4em 0 0 0 173 | text-align: center 174 | > li 175 | list-style: none 176 | a 177 | border-bottom: none 178 | 179 | @media screen and (max-width: 1024px) 180 | .container 181 | fill-full(0, 0) 182 | padding-top: 20em 183 | overflow-x: hidden 184 | max-width: none 185 | width: auto 186 | &::before 187 | content: '' 188 | display: block 189 | position: relative 190 | height: 1px 191 | width: 10% 192 | background-color: #cdcdcd 193 | top: 3.5em 194 | margin: auto 195 | .Archives 196 | padding: 0 16px 197 | margin-top: 7em 198 | .container > * 199 | margin-left: 4% 200 | margin-right: 4% 201 | @media screen and (max-width: 450px) 202 | html, body 203 | font-size: 90% 204 | blockquote 205 | padding: 0 10px 206 | code pre 207 | font-size: 80% 208 | .title h1, 209 | .PageTitle h1 210 | font-size: 1.3rem !important 211 | 212 | -------------------------------------------------------------------------------- /source/css/disqusjs.css: -------------------------------------------------------------------------------- 1 | /*! DisqusJS - Default Theme | v1.3.0 | Sukka (https://skk.moe) | https://disqusjs.skk.moe | MIT License */#dsqjs *{margin:0;padding:0}#dsqjs a{text-decoration:none;color:#076dd0}#dsqjs .dsqjs-hide{display:none!important}#dsqjs .dsqjs-disabled{cursor:not-allowed;opacity:.5}#dsqjs #dsqjs-msg{text-align:center;margin-top:4px;margin-bottom:4px;font-size:14px}#dsqjs #dsqjs-msg .dsqjs-msg-btn{cursor:pointer}#dsqjs .dsqjs-bullet{line-height:1.4;margin:0 2px}#dsqjs .dsqjs-bullet::after{color:#c2c6cc;content:"·";font-weight:700}#dsqjs .dsqjs-clearfix:after,#dsqjs .dsqjs-clearfix:before{display:table;content:"";line-height:0;clear:both}#dsqjs .dsqjs-nav{position:relative;margin:0 0 20px;border-bottom:2px solid #e7e9ee}#dsqjs ol,#dsqjs ul{list-style:none;list-style-type:none}#dsqjs .dsqjs-no-comment{text-align:center;font-size:16px;line-height:1.5;word-wrap:break-word;overflow:hidden;color:#2a2e2e;margin-bottom:6px}#dsqjs .dsqjs-nav-tab{float:left;text-transform:capitalize;font-size:15px;padding:12px 8px;color:#656c7a;display:block;margin:0 15px 0 0;font-weight:700;line-height:1;position:relative;-webkit-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out}#dsqjs .dsqjs-nav-tab:last-child{margin:0}#dsqjs .dsqjs-tab-active{color:#2a2e2e}#dsqjs .dsqjs-tab-active>span:after{content:" ";display:block;height:2px;background-color:#076dd0!important;position:absolute;bottom:-5px;left:0;right:0}#dsqjs .dsqjs-post-list .dsqjs-post-item{position:relative;margin-bottom:16px}#dsqjs .dsqjs-post-list .dsqjs-post-avatar{float:left;margin-right:10px;position:relative;background:#dbdfe4;padding:0;display:block;border-radius:4px}#dsqjs .dsqjs-post-list .dsqjs-post-avatar img{width:44px;height:44px;display:block;border-radius:4px}#dsqjs .dsqjs-post-list .dsqjs-post-header{line-height:1;font-size:14px;margin-bottom:3px}#dsqjs .dsqjs-post-list .dsqjs-post-header .dsqjs-post-author{color:#656c7a;font-weight:700}#dsqjs .dsqjs-post-list .dsqjs-post-header .dsqjs-admin-badge{color:#fff;background:#687a86;padding:1px 3px;margin-left:4px;font-size:12px;line-height:1;font-weight:700;border-radius:3px;display:inline-block;position:relative;top:-1px;left:1px}#dsqjs .dsqjs-post-list .dsqjs-post-header .dsqjs-meta{display:inline-block;font-size:12px;color:#656c7a}#dsqjs .dsqjs-post-body{font-size:15px;line-height:1.5;word-wrap:break-word;overflow:hidden;color:#2a2e2e}#dsqjs .dsqjs-post-body code{padding:.2em .4em;margin:0;font-size:85%;background:#f5f5f5;color:inherit;border-radius:3px}#dsqjs .dsqjs-post-body pre{padding:.5em;overflow:auto;font-size:85%;line-height:1.45;border-radius:3px;background:#f5f5f5;margin:.5em 0}#dsqjs .dsqjs-post-body blockquote{padding:0 .8em;margin:.5em 0;color:#6a737d;border-left:.25em solid #dfe2e5}#dsqjs .dsqjs-post-body p:last-child{margin:0}#dsqjs .dsqjs-post-list.dsqjs-children>li{margin-left:30px}@media (min-width:768px){#dsqjs .dsqjs-post-list.dsqjs-children>li{margin-left:48px}#dsqjs .dsqjs-post-list .dsqjs-post-avatar{margin-right:12px}#dsqjs .dsqjs-post-list .dsqjs-post-item{margin-bottom:20px}}@media (min-width:1024px){#dsqjs .dsqjs-post-list.dsqjs-children>li{margin-left:60px}}#dsqjs .dsqjs-post-list.dsqjs-children .dsqjs-post-avatar img{width:38px;height:38px}#dsqjs .dsqjs-load-more{font-size:14px;font-weight:400;display:block;text-align:center;padding:11px 14px;margin:0 0 24px;background:#687a86;color:#fff;cursor:pointer}#dsqjs .dsqjs-load-more:hover{opacity:.8}#dsqjs footer{text-align:right;line-height:1.5;padding-top:10px;padding-right:10px;border-top:2px solid #e7e9ee;margin-top:12px;font-weight:700;font-size:16px;color:#555}#dsqjs .dsqjs-disqus-logo{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 438 80'%3e%3cpath fill='%23575B5D' d='M30.2 1.6H1v76h28.9C57 77.6 73 61.3 73 39.4v-.2c0-22-15.7-37.6-42.9-37.6zm21.3 38.1c0 12.3-8.4 19.3-21 19.3H22V20.3h8.5c12.6 0 21 7 21 19.2v.2zm35.6 38h21.2V1.5H87.1v76zm70-47.4c-10.4-2.4-13-4-13-7.4v-.2c0-2.7 2.4-5 7.6-5 6.7 0 14.3 2.7 21.2 7.6l10.6-14.9A47.9 47.9 0 0 0 152.2.3c-18.3 0-29.4 10.2-29.4 24.3v.2c0 15.7 12.4 20.3 28.6 24 10.4 2.3 12.9 4 12.9 7.2v.2c0 3.3-3 5.2-8.7 5.2-8.8 0-17.2-3.1-24.7-9l-11.7 14a53.1 53.1 0 0 0 35.6 12.5c18.5 0 30.7-9.2 30.7-24.7V54c0-14.3-10.8-20-28.3-23.7zm120.7 9.3v-.2A39.5 39.5 0 0 0 236.9.1c-23.4 0-41 17.7-41 39.5v.2a39.5 39.5 0 0 0 40.8 39.4c8.7 0 16.6-2.5 23.1-6.8l8.4 7.5L279 68.1l-7.9-6.6a38 38 0 0 0 6.8-21.9zm-21.4.5c0 2.6-.5 5-1.3 7.3l-10.4-9.3-10.6 12 10.5 9a21.7 21.7 0 0 1-7.7 1.4c-11.6 0-19.4-9.7-19.4-20.7v-.2c0-11 7.7-20.5 19.2-20.5 11.7 0 19.7 9.7 19.7 20.7v.3zm83.5 4.3c0 10.6-5.5 15.6-14 15.6s-14-5.2-14-16.1V1.6h-21.4v42.7C290.5 68 304 79 325.7 79s35.6-10.8 35.6-35.3V1.5h-21.4v42.8zm68.9-14.1c-10.6-2.4-13.2-4-13.2-7.4v-.2c0-2.7 2.5-5 7.6-5 6.8 0 14.4 2.7 21.3 7.6l10.6-14.9A47.9 47.9 0 0 0 403.8.3c-18.3 0-29.5 10.2-29.5 24.3v.2c0 15.7 12.5 20.3 28.7 24 10.3 2.3 12.8 4 12.8 7.2v.2c0 3.3-3 5.3-8.7 5.3-8.8 0-17.1-3.2-24.6-9.2l-11.7 14A53.1 53.1 0 0 0 406.4 79c18.5 0 30.7-9.2 30.7-24.7V54c0-14.3-10.8-20-28.3-23.7z'/%3e%3c/svg%3e");background-position:50% 50%;background-repeat:no-repeat;display:inline-block;height:12px;width:65.7px}#dsqjs .dsqjs-order{display:-webkit-box;display:-ms-flexbox;display:flex;float:right;-webkit-box-align:center;-ms-flex-align:center;align-items:center;margin-top:10px;margin-bottom:12px}#dsqjs .dsqjs-order-radio{display:none}#dsqjs .dsqjs-order-radio:checked+.dsqjs-order-label{color:#fff;background-color:#888}#dsqjs .dsqjs-order-label{display:block;height:20px;line-height:20px;margin-right:10px;font-size:12px;border-radius:2px;padding:0 5px;background-color:#dcdcdc;cursor:pointer}#dsqjs p.dsqjs-has-more{margin-bottom:24px;margin-left:48px;font-size:13px;line-height:15px}#dsqjs p.dsqjs-has-more a.dsqjs-has-more-btn{color:#656c7a;text-decoration:underline;cursor:pointer} -------------------------------------------------------------------------------- /layout/_partial/inline-style.ejs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /source/js/instantclick.min.js: -------------------------------------------------------------------------------- 1 | !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.InstantClick=t()}(this,function(){"use strict";return function(e,t,n){function r(e){var t=e.indexOf("#");return-1==t?e:e.substr(0,t)}function i(e){for(;e&&"A"!=e.nodeName;)e=e.parentNode;return e}function o(e){do{if(!e.hasAttribute)break;if(e.hasAttribute("data-instant"))return!1;if(e.hasAttribute("data-no-instant"))return!0}while(e=e.parentNode);return!1}function a(e){var n=t.protocol+"//"+t.host;return!(e.target||e.hasAttribute("download")||0!=e.href.indexOf(n+"/")||e.href.indexOf("#")>-1&&r(e.href)==I||o(e))}function f(e){for(var t=Array.prototype.slice.call(arguments,1),n=!1,r=0;r-1&&(e.title==i?e.title=i+String.fromCharCode(160):e.title=i));var s=a.indexOf("#"),h=s>-1&&e.getElementById(a.substr(s+1)),m=0;if(h)for(;h.offsetParent;)m+=h.offsetTop,h=h.offsetParent;"requestAnimationFrame"in window?requestAnimationFrame(function(){scrollTo(0,m)}):scrollTo(0,m),u(),(I=r(a))in re&&(re[I]=[]),te[I]={},g(function(e){return!e.hasAttribute("data-instant-track")}),f("change",!1)}else scrollTo(0,l),R.abort(),d(),g(function(e){return e.hasAttribute("data-instant-restore")}),p(),f("restore")}function d(){Q=!1,V=!1}function s(e){return e.replace(//gi,"")}function c(){for(var e=0;e+new Date-500||+new Date-J<100)){var t=i(e.target);t&&t!=i(e.relatedTarget)&&a(t)&&(t.addEventListener("mouseout",L),V||(M=t.href,N=O(T,_)))}}function E(e){B=+new Date;var t=i(e.target);t&&a(t)&&(H&&(D(H),H=!1),t.addEventListener("touchend",k),t.addEventListener("touchcancel",k),T(t.href))}function x(){e.addEventListener("click",A)}function A(t){if(e.removeEventListener("click",A),H&&(D(H),H=!1),!t.defaultPrevented){var n=i(t.target);n&&a(n)&&(0!=t.button||t.metaKey||t.ctrlKey||(t.preventDefault(),C(n.href)))}}function L(e){if(i(e.target)!=i(e.relatedTarget))return N?(D(N),void(N=!1)):void(Q&&!V&&(R.abort(),d()))}function k(e){Q&&!V&&(H=O(h,500))}function P(){if(2==R.readyState){var n=R.getResponseHeader("Content-Type");n&&/^text\/html/i.test(n)||(Y=!0)}if(!(R.readyState<4)){if(0==R.status)return Z=!0,void(V&&(f("exit",W,"network error"),t.href=W));if(Y)V&&(f("exit",W,"non-html content-type"),t.href=W);else{var i=e.implementation.createHTMLDocument("");i.documentElement.innerHTML=s(R.responseText),X=i.title,z=i.body;var o=f("receive",W,z,X);o&&("body"in o&&(z=o.body),"title"in o&&(X=o.title));var a=r(W);U[a]={body:z,title:X,scrollPosition:a in U?U[a].scrollPosition:0};var l,d,c=i.querySelectorAll("[data-instant-track]");if(c.length!=$.length)j=!0;else for(var u=0;u-1&&ie[t][e].splice(r,1)}var I,M,N,B,F,H,R,Y,j,K,G=0,U={},W=!1,X=!1,z=!1,J=0,Q=!1,V=!1,Z=!1,$=[],_=65,ee={preload:[],receive:[],wait:[],change:[],restore:[],exit:[]},te={},ne=[],re={},ie={};Element.prototype.matches||(Element.prototype.matches=Element.prototype.webkitMatchesSelector||Element.prototype.msMatchesSelector||function(t){for(var n=this,r=e.querySelectorAll(t),i=0;i-1){var fe=parseFloat(n.substr(ae+"Android ".length));if(fe<4.4&&(oe=!1,fe>=4))for(var le=[/ Chrome\//,/ UCBrowser\//,/ Firefox\//,/ Windows Phone /],de=0;de !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.InstantClick=t()}(this,function(){"use strict";return function(e,t,n){function r(e){var t=e.indexOf("#");return-1==t?e:e.substr(0,t)}function i(e){for(;e&&"A"!=e.nodeName;)e=e.parentNode;return e}function o(e){do{if(!e.hasAttribute)break;if(e.hasAttribute("data-instant"))return!1;if(e.hasAttribute("data-no-instant"))return!0}while(e=e.parentNode);return!1}function a(e){var n=t.protocol+"//"+t.host;return!(e.target||e.hasAttribute("download")||0!=e.href.indexOf(n+"/")||e.href.indexOf("#")>-1&&r(e.href)==I||o(e))}function f(e){for(var t=Array.prototype.slice.call(arguments,1),n=!1,r=0;r-1&&(e.title==i?e.title=i+String.fromCharCode(160):e.title=i));var s=a.indexOf("#"),h=s>-1&&e.getElementById(a.substr(s+1)),m=0;if(h)for(;h.offsetParent;)m+=h.offsetTop,h=h.offsetParent;"requestAnimationFrame"in window?requestAnimationFrame(function(){scrollTo(0,m)}):scrollTo(0,m),u(),(I=r(a))in re&&(re[I]=[]),te[I]={},g(function(e){return!e.hasAttribute("data-instant-track")}),f("change",!1)}else scrollTo(0,l),R.abort(),d(),g(function(e){return e.hasAttribute("data-instant-restore")}),p(),f("restore")}function d(){Q=!1,V=!1}function s(e){return e.replace(//gi,"")}function c(){for(var e=0;e+new Date-500||+new Date-J<100)){var t=i(e.target);t&&t!=i(e.relatedTarget)&&a(t)&&(t.addEventListener("mouseout",L),V||(M=t.href,N=O(T,_)))}}function E(e){B=+new Date;var t=i(e.target);t&&a(t)&&(H&&(D(H),H=!1),t.addEventListener("touchend",k),t.addEventListener("touchcancel",k),T(t.href))}function x(){e.addEventListener("click",A)}function A(t){if(e.removeEventListener("click",A),H&&(D(H),H=!1),!t.defaultPrevented){var n=i(t.target);n&&a(n)&&(0!=t.button||t.metaKey||t.ctrlKey||(t.preventDefault(),C(n.href)))}}function L(e){if(i(e.target)!=i(e.relatedTarget))return N?(D(N),void(N=!1)):void(Q&&!V&&(R.abort(),d()))}function k(e){Q&&!V&&(H=O(h,500))}function P(){if(2==R.readyState){var n=R.getResponseHeader("Content-Type");n&&/^text\/html/i.test(n)||(Y=!0)}if(!(R.readyState<4)){if(0==R.status)return Z=!0,void(V&&(f("exit",W,"network error"),t.href=W));if(Y)V&&(f("exit",W,"non-html content-type"),t.href=W);else{var i=e.implementation.createHTMLDocument("");i.documentElement.innerHTML=s(R.responseText),X=i.title,z=i.body;var o=f("receive",W,z,X);o&&("body"in o&&(z=o.body),"title"in o&&(X=o.title));var a=r(W);U[a]={body:z,title:X,scrollPosition:a in U?U[a].scrollPosition:0};var l,d,c=i.querySelectorAll("[data-instant-track]");if(c.length!=$.length)j=!0;else for(var u=0;u-1&&ie[t][e].splice(r,1)}var I,M,N,B,F,H,R,Y,j,K,G=0,U={},W=!1,X=!1,z=!1,J=0,Q=!1,V=!1,Z=!1,$=[],_=65,ee={preload:[],receive:[],wait:[],change:[],restore:[],exit:[]},te={},ne=[],re={},ie={};Element.prototype.matches||(Element.prototype.matches=Element.prototype.webkitMatchesSelector||Element.prototype.msMatchesSelector||function(t){for(var n=this,r=e.querySelectorAll(t),i=0;i-1){var fe=parseFloat(n.substr(ae+"Android ".length));if(fe<4.4&&(oe=!1,fe>=4))for(var le=[/ Chrome\//,/ UCBrowser\//,/ Firefox\//,/ Windows Phone /],de=0;de -------------------------------------------------------------------------------- /source/js/disqus.js: -------------------------------------------------------------------------------- 1 | /*! DisqusJS v1.3.0 | Sukka (https://skk.moe) | https://disqusjs.skk.moe | MIT License */"use strict";function DisqusJS(C){!function(e,p,t,n,o){function r(){for(var s=arguments.length,e=new Array(s),t=0;t & DisqusJS

    ',u=function(s,e){return'
    '},g=function(s,e,t){var n=s.avatarEl,r=s.createdAt;return'
    '+n+'
    '+e+'
    '+t+"
    "},v='如需完整体验请针对 disq.us | disquscdn.com | disqus.com 启用代理并 尝试完整 Disqus 模式 | 强制完整 Disqus 模式',b=function(s){return n(s,{method:"GET"}).then(function(s){return o.all([s.ok,s.status,s.json(),s.headers])}).then(function(s){var e=s[0],t=s[1],n=s[2],r=s[3];if(e)return{ok:e,status:t,data:n,headers:r};throw new Error}).catch(function(s){throw s})},y=function(s,e){try{t.setItem(s,e)}catch(s){}},a=function(s){function e(s){return s<10?"0"+s:s}return s=Date.parse(new Date(s)),(s=new Date(s+288e5)).getFullYear()+"-"+e(s.getMonth()+1)+"-"+e(s.getDate())+" "+e(s.getHours())+":"+e(s.getMinutes())};function s(){var s;e.DISQUS?e.DISQUS.reset({reload:!0,config:function(){this.page.identifier=M.config.identifier,this.page.url=M.config.url,this.page.title=M.config.title}}):(s=p.createElement("script"),q(d).innerHTML='
    评论完整模式加载中... 如果长时间无法加载,请针对 disq.us | disquscdn.com | disqus.com 启用代理,或切换至 评论基础模式
    '+l+"
    ",q("dsqjs-force-dsqjs").addEventListener(h,D),s.src="https://"+M.config.shortname+".disqus.com/embed.js",s.setAttribute("data-timestamp",+new Date),(p.head||p.body).appendChild(s))}function E(){q(d).innerHTML='
    正在检查 Disqus 能否访问...
    '+l+"
    ";function s(r){return new o(function(s,e){var t=new Image,n=setTimeout(function(){t.onerror=t.onload=null,e()},3e3);t.onerror=function(){clearTimeout(n),e()},t.onload=function(){clearTimeout(n),s()},t.src="https://"+r+"/favicon.ico?"+ +new Date+"="+ +new Date})}return o.all([s("disqus.com"),s(M.config.shortname+".disqus.com")]).then(w,D)}function L(){q("dsqjs-reload-disqus").addEventListener(h,E),q("dsqjs-force-disqus").addEventListener(h,w)}function i(){f("评论基础模式加载中... "+v),L();var s=M.config.api+"3.0/threads/list.json?forum="+encodeURIComponent(M.config.shortname)+"&thread="+encodeURIComponent("ident:"+M.config.identifier)+"&api_key="+encodeURIComponent(k());b(s).then(function(s){var e=s.data;if(0===e.code&&1===e.response.length){var t=e.response[0],n=t.id,r=t.title,o=t.isClosed,a=t.posts;M.page={id:n,title:r,isClosed:o,length:a,comment:[]},q(d).innerHTML='
    评论基础模式加载中... '+v+"
    "+u(a,M.config.siteName)+'

      评论列表加载中...

    加载更多评论
    '+l+"
    ",L(),q("dsqjs-order-"+M.sortType).setAttribute("checked","true"),i()}else{if(0!==e.code||1===e.response.length)throw new Error;f('当前 Thread 尚未创建。是否切换至 完整 Disqus 模式?'),q("dsqjs-force-disqus").addEventListener(h,w)}}).catch(T);function e(s){function n(s){return{comment:s,author:s.author.name,isPrimary:!!M.config.admin&&s.author.username===M.config.admin,children:t(+s.id),hasMore:s.hasMore}}var e=[],r=[],t=function(e){if(0===r.length)return null;var t=[];return r.forEach(function(s){s.parent===e&&t.unshift(n(s))}),t.length?t:null};return s.forEach(function(s){(s.parent?r:e).push(s)}),e.map(n)}var i=function t(s){void 0===s&&(s="");function n(){Array.prototype.slice.call(o).forEach(function(s){return s.removeEventListener("change",d)}),r.removeEventListener(h,i),Array.prototype.slice.call(a).forEach(function(s){return s.removeEventListener(h,E)})}var r=q("dsqjs-load-more"),o=p.getElementsByClassName("dsqjs-order-radio"),a=p.getElementsByClassName("dsqjs-has-more-btn"),i=function(){n(),t(M.page.next)},d=function(s){var e=s.target;M.sortType=e.getAttribute("value"),y(j,M.sortType),n(),M.page.comment=[],M.page.next="",q("dsqjs-post-container").innerHTML='

    正在切换排序方式...

    ',r.classList.add("dsqjs-hide"),t()},e=""===s?"":"&cursor="+s;r.classList.add("dsqjs-disabled");function c(s){var e=s.createdAt;return Date.parse(new Date(e))}function l(s,e){return s.parent&&e.parent?c(s)-c(e):0}var u=M.config.api+"3.0/threads/listPostsThreaded?forum="+encodeURIComponent(M.config.shortname)+"&thread="+encodeURIComponent(M.page.id)+encodeURIComponent(e)+"&api_key="+encodeURIComponent(k())+"&order="+encodeURIComponent(M.sortType);b(u).then(function(s){var e,t=s.data;if(0===t.code&&0",L(),q("dsqjs-force-disqus").addEventListener(h,D)}}).catch(function(){""===s?T():(r.classList.remove("dsqjs-disabled"),r.innerHTML="加载更多评论失败,点击重试",r.addEventListener(h,i))})},m=function(s){function o(s){return s.comment.author.profileUrl?(s.comment.avatarEl='",s.comment.authorEl='"):(s.comment.avatarEl='',s.comment.authorEl='"),M.config.adminLabel&&s.isPrimary&&(s.comment.authorEl+=''+M.config.adminLabel+""),s}function a(s){var e="",t="",t=s.isDeleted?"此评论已被删除":(e=s.authorEl+'',function(s){var e=p.createElement("div");e.innerHTML=s;var t=e.getElementsByTagName("a");return Array.prototype.slice.call(t).forEach(function(s){var e=decodeURIComponent(s.href.replace(/https:\/\/disq\.us\/url\?url=/g,"")).replace(/(.*):.+cuid=.*/,"$1");s.href=e,s.innerHTML=e,s.rel="external noopener nofollow noreferrer",s.target="_blank"}),e.innerHTML}(n(s.message)));return g(s,e,t)}var n=function(s){return s.replace(/a\.disquscdn\.com/g,"c.disquscdn.com")},t="";e(s).map(function(s){s.children&&(s.nesting=1);var e="";(s=o(s)).hasMore&&(e='

    切换至 完整 Disqus 模式 显示更多回复

    '),t+='
  • '+a(s.comment)+function t(s){var n=s.nesting,e=s.children||[];if(e){var r="",r=n':'
      ';return e.map(function(s){(s=o(s)).nesting=n+1;var e=s.hasMore?'

      切换至 完整 Disqus 模式 显示更多回复

      ':"";r+='
    • '+a(s.comment)+t(s)+e+"
    • "}),0!==(r+="
    ").length?r:void 0}}(s)+e+"
  • "}),f("你可能无法访问 Disqus,已启用评论基础模式。"+v),q("dsqjs-post-container").innerHTML=t,L()}}function T(s){console.log(s),f('评论基础模式加载失败,是否 重载尝试完整 Disqus 模式 ?'),q("dsqjs-reload-dsqjs").addEventListener(h,i),q("dsqjs-reload-disqus").addEventListener(h,E)}function D(){y("dsqjs_mode","dsqjs"),i()}function w(){y("dsqjs_mode","disqus"),s()}var M={},m=p.location.origin+p.location.pathname+p.location.search;M.config=r({api:"https://disqus.skk.moe/disqus/",identifier:m,url:m,title:p.title,siteName:"",nesting:parseInt(C.nesting)||4,nocomment:"这里冷冷清清的,一条评论都没有"},C),M.page={};var I=M.config.apikey,k=function(){return Array.isArray(I)?I[Math.floor(Math.random()*I.length)]:I};e.disqus_config=function(){this.page.url=M.config.url,this.page.identifier=M.config.identifier,this.page.title=M.config.title},q(d).innerHTML='
    '+l+"
    ",n&&t&&o?(M.mode=t.getItem("dsqjs_mode"),M.sortType=t.getItem(j)||t.getItem("disqus.sort"),M.sortType||(y(j,"desc"),M.sortType="desc"),("disqus"===M.mode?s:"dsqjs"===M.mode?i:E)()):(f("你的浏览器版本过低,不兼容评论基础模式。"+v),L())}(window,document,localStorage,fetch,Promise)}try{module.exports=DisqusJS}catch(s){} -------------------------------------------------------------------------------- /source/assets/by-nc-nd.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 19 | 21 | 24 | 31 | 32 | 33 | 56 | 58 | 59 | 61 | image/svg+xml 62 | 64 | 65 | 66 | 67 | 71 | 74 | 77 | 84 | 91 | 96 | 100 | 109 | 113 | 114 | 115 | 119 | 120 | 121 | 122 | --------------------------------------------------------------------------------