hexo遇到的异常

异常

今天写篇日常博客,运行$ hexo s -debug 命令,居然报错!

显示如下:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
INFO Start processing
FATAL Something's wrong. Maybe you can find the solution here: http://hexo.io/docs/troubleshooting.html
Template render error: (unknown path) [Line 67, Column 20]expected variable end
at Object.exports.prettifyError (D:\wodewangzhan\node_modules\nunjucks\src\lib.js:34:15)
at new_cls.render (D:\wodewangzhan\node_modules\nunjucks\src\environment.js:469:27)
at new_cls.renderString (D:\wodewangzhan\node_modules\nunjucks\src\environment.js:327:21)
at D:\wodewangzhan\node_modules\hexo\lib\extend\tag.js:66:9
at Promise._execute (D:\wodewangzhan\node_modules\bluebird\js\release\debuggability.js:300:9)
at Promise._resolveFromExecutor (D:\wodewangzhan\node_modules\bluebird\js\release\promise.js:483:18)
at new Promise (D:\wodewangzhan\node_modules\bluebird\js\release\promise.js:79:10)
at Tag.render (D:\wodewangzhan\node_modules\hexo\lib\extend\tag.js:64:10)
at Object.tagFilter [as onRenderEnd] (D:\wodewangzhan\node_modules\hexo\lib\hexo\post.js:266:16)
at D:\wodewangzhan\node_modules\hexo\lib\hexo\render.js:65:19
at tryCatcher (D:\wodewangzhan\node_modules\bluebird\js\release\util.js:16:23)
at Promise._settlePromiseFromHandler (D:\wodewangzhan\node_modules\bluebird\js\release\promise.js:512:31)
at Promise._settlePromise (D:\wodewangzhan\node_modules\bluebird\js\release\promise.js:569:18)
at Promise._settlePromise0 (D:\wodewangzhan\node_modules\bluebird\js\release\promise.js:614:10)
at Promise._settlePromises (D:\wodewangzhan\node_modules\bluebird\js\release \promise.js:693:18)
at Async._drainQueue (D:\wodewangzhan\node_modules\bluebird\js\release\async.js:133:16)
at Async._drainQueues (D:\wodewangzhan\node_modules\bluebird\js\release\async.js:143:10)
at Immediate.Async.drainQueues [as _onImmediate] (D:\wodewangzhan\node_modules\bluebird\js\release\async.js:17:14)
at runCallback (timers.js:781:20)
at tryOnImmediate (timers.js:743:5)
at processImmediate [as _immediateCallback] (timers.js:714:5)

Template render error 模板渲染错误

百度了很久,才发现可能是标记异常,赶紧回原文看了看
原来是文章中使用了大括号 { } 这个特殊字符,且没有转义导致编译不通过

  • 解决方案:将 { } 的大括号通过{ } 进行转换