#1、Hexo无法解析模板文件

hexo clean
hexo generate

然后打开页面显示的是:

1
2
3
4
5
6
<%- partial('_partial/head') %>
<%- partial('_partial/header') %>
<%- body %>
<% if (theme.sidebar && theme.sidebar !== 'bottom'){ %> <%- partial('_partial/sidebar') %> <% } %>
<%- partial('_partial/footer') %>
<%- partial('_partial/mobile-nav') %> <%- partial('_partial/after-footer') %>

theme使用的是默认的landscape

解决方案:

在工程目录执行下面3个命令,高版本的hexo移除默认的ejs

1
2
3
$ npm install hexo-renderer-ejs --save
$ npm install hexo-renderer-stylus --save
$ npm install hexo-renderer-marked --save

#2、中文乱码

解决方案:将md文件和yml文件的格式设置为UTF-8