记录Hexo优化及主题NexT美化
@toc
主题插件
「盘古之白」
為什麼你們就是不能加個空格呢? by pangu.js
「盤古之白」,它劈開了全形字和半形字之間的混沌。另有研究顯示,打字的時候不喜歡在中文和英文之間加空格的人,感情路都走得很辛苦,有七成的比例會在 34 歲的時候跟自己不愛的人結婚,而其餘三成的人最後只能把遺產留給自己的貓。畢竟愛情跟書寫都需要適時地留白。
與大家共勉之。
1 | $ cd themes/next |
_themes/next/_config.yaml_修改
1 | # Pangu Support |
静态资源压缩
常规的做法是使用gulp
来进行压缩,gulp
是Node.js
下的自动构建工具,通过一列的task执行步骤进行自动流程化处理。
这里使用hexo-neat
压缩插件,配置简单,可以自动完成静态资源的压缩
1 | $ npm install hexo-neat --save |
添加以下配置到站点配置文件_config.yml
的末尾
1 | # hexo-neat |
更换Pandoc引擎解析数学公式
默认Marked引擎渲染数学公式时与Latex冲突,换用比较重量级的插件Pandoc
npm uninstall hexo-renderer-marked –save
1 | $ npm uninstall hexo-renderer-marked --save |
注:hexo-renderer-pandoc最新version 0.2.4仍有bug详见issue #21
增加功能
运行时间
修改文件位置:~/blog/themes/next/layout/_custom/sidebar.swig
1 | <div id="days"></div> |
修改样式文件位置:~/blog/themes/next/source/css/_custom/custom.styl
1 | // 自定义的侧栏时间样式 |
效果