1,Hexo无法解析模板文件

hexo clean
hexo generate

然后打开页面显示的是:

<%- 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,网上一堆的教程从未提及这个问题,难道都没有遇到?!!!

$ npm install hexo-renderer-ejs --save
$ npm install hexo-renderer-stylus --save
$ npm install hexo-renderer-marked --save

https://github.com/hexojs/hexo/releases/tag/2.6.0

2、中文乱码

需要将md文件和yml文件的格式设置为UTF-8




Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐