为Hexo使用Material主题
开始入门
下载主题
方式一:直接下载源代码
下载后放在theme文件夹里。
Download latest release version
方式二:使用Git下载
你可以自己决定想要使用的分支;仅限开发者使用。
cd themes
git clone https://github.com/viosey/hexo-theme-material.git material
cd material
git checkout {branch/tags name}
应用主题
修改主目录的_config.yml
文件中的theme
属性为material
。
theme: material
使用站内搜索插件
安装 hexo-generator-search 插件。
修改theme/material 目录 _config.yml
中的 search值
search:
use: local
swiftype_key:
然后在主目录的_config.yml
文件中添加
search:
path: search.xml
field: all
修改配置文件
修改theme/material/layout/_widget/dnsprefetch.ejs文件,否则会报错,修改内容如下:
<% } else if(theme.comment.use.startsWith("disqus")) { %>
// 修改为
<% } else if(theme.comment.use && theme.comment.use.startsWith("disqus")) { %>