pure
A brand new default theme for [Hexo]. Preview | English documentation
外观
首页 | 归档 | 分类 | 标签 | 项目 | 书单 | 友链 | 关于
启用主题
Execute the following command under your hexo
folder.
git clone https://github.com/cofess/hexo-theme-pure.git themes/pure |
Then modify the property theme
of the file hexo/_config.yml
to theme: pure
更新主题
Execute the following command to update theme.
cd themes/pure |
安装插件
hexo-wordcount
npm install hexo-wordcount --save |
hexo-generator-json-content
npm install hexo-generator-json-content --save |
hexo-generator-feed
npm install hexo-generator-feed --save |
hexo-generator-sitemap
npm install hexo-generator-sitemap --save |
hexo-generator-baidu-sitemap
npm install hexo-generator-baidu-sitemap --save |
主题配置
导航菜单
# 导航菜单 |
搜索
主题内置三种站内搜索方式:insight、swiftype、baidu
# Search |
分享
支持weibo,qq,qzone,wechat,tencent,douban,diandian,facebook,twitter,google,linkedin
# Share |
评论
主题集成了disqus、友言、来必力、gitment评论系统,选择其中一种即可
# Comment |
Github respostory
复制theme/pure/_source/
目录下repository
文件夹到blog path/source/
目录下
# Github |
豆瓣书单
复制theme/pure/_source/
目录下books
文件夹到blog path/source/
目录下
# douban 豆瓣书单 |
友情链接
复制theme/pure/_source/
目录下links
文件夹到blog path/source/
目录下
在 hexo 目录下的 source 文件夹内创建一个名为 _data(禁止改名)的文件夹。
然后在文件内创建一个名为 links.yml 的文件,在其中添加相关数据即可。
单个友情链接的格式为:
Name: |
添加多个友情链接,我们只需要根据上面的格式重复填写即可。
. 将 Name 改为友情链接的名字,例如 Cofess。
. http://example.com 为友情链接的地址。
. http://example.com/avatar.png 为友情链接的头像。
. 这是一个描述 为友情链接描述。
文章启用目录索引
title: 文章标题 |
博客优化
hexo-neat
auto Minify html、js、css and make it neat
npm install hexo-neat --save |
在博客配置文件_config.yml
中添加
# hexo-neat |
hexo-baidu-url-submit
npm install hexo-baidu-url-submit --save |
hexo-translate-title
使用Google翻译,百度翻译和有道翻译将Hexo中的汉字标题转成英文标题
安装
npm install hexo-translate-title --save |
在博客配置文件_config.yml
中添加
translate_title: |
注意:判断是否需要配置google本地代理,因为我在本地是开启时才能访问google翻译的,如果没有被墙,请将_config.yml
下的is_need_proxy: true
改为false。如果设置为true,请设置本地代理地址
数学公式
Hexo默认使用"hexo-renderer-marked"引擎渲染网页,该引擎会把一些特殊的markdown符号转换为相应的html标签
解决方案
解决方案有很多,可以网上搜下,为了节省大家的时间,这里只提供亲身测试过的方法。
更换Hexo的markdown渲染引擎,hexo-renderer-markdown-it-plus引擎替换默认的渲染引擎hexo-renderer-marked即可。
安装hexo-renderer-markdown-it-plus插件
npm un hexo-renderer-marked --save |
配置
安装插件后,如果未正常渲染LaTeX数学公式,在博客配置文件_config.yml
中添加
markdown_it_plus: |
文章启用mathjax
title: Hello World |