Code Monkey home page Code Monkey logo

michaelooo.github.io's Issues

hexo generate 报错

问题:

执行 hexo g 时偶然报错,报错内容如下:

Template render error: (unknown path) [Line 114, Column 67]
expected variable end
at Object.exports.prettifyError (/Users/user/Documents/michael/cpf_blog/node_modules/nunjucks/src/lib.js:34:15)
at new_cls.render (/Users/user/Documents/michael/cpf_blog/node_modules/nunjucks/src/environment.js:472:27)
at new_cls.renderString (/Users/user/Documents/michael/cpf_blog/node_modules/nunjucks/src/environment.js:328:21)
at /Users/user/Documents/michael/cpf_blog/node_modules/hexo/lib/extend/tag.js:66:9
at Promise._execute (/Users/user/Documents/michael/cpf_blog/node_modules/bluebird/js/release/debuggability.js:303:9)
at Promise._resolveFromExecutor (/Users/user/Documents/michael/cpf_blog/node_modules/bluebird/js/release/promise.js:483:18)
at new Promise (/Users/user/Documents/michael/cpf_blog/node_modules/bluebird/js/release/promise.js:79:10)
at Tag.render (/Users/user/Documents/michael/cpf_blog/node_modules/hexo/lib/extend/tag.js:64:10)
at Object.tagFilter [as onRenderEnd] (/Users/user/Documents/michael/cpf_blog/node_modules/hexo/lib/hexo/post.js:266:16)
at /Users/user/Documents/michael/cpf_blog/node_modules/hexo/lib/hexo/render.js:65:19
at tryCatcher (/Users/user/Documents/michael/cpf_blog/node_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/Users/user/Documents/michael/cpf_blog/node_modules/bluebird/js/release/promise.js:512:31)
at Promise._settlePromise (/Users/user/Documents/michael/cpf_blog/node_modules/bluebird/js/release/promise.js:569:18)
at Promise._settlePromise0 (/Users/user/Documents/michael/cpf_blog/node_modules/bluebird/js/release/promise.js:614:10)
at Promise._settlePromises (/Users/user/Documents/michael/cpf_blog/node_modules/bluebird/js/release/promise.js:693:18)
at Async._drainQueue (/Users/user/Documents/michael/cpf_blog/node_modules/bluebird/js/release/async.js:133:16)
at Async._drainQueues (/Users/user/Documents/michael/cpf_blog/node_modules/bluebird/js/release/async.js:143:10)
at Immediate.Async.drainQueues (/Users/user/Documents/michael/cpf_blog/node_modules/bluebird/js/release/async.js:17:14)
at runCallback (timers.js:672:20)
at tryOnImmediate (timers.js:645:5)
at processImmediate [as _immediateCallback] (timers.js:617:5)

尝试使用 hexo g --debug ,检查 config.yaml 并未发现语法错误,文章在其他便捷器显示正常,没有明显语法错误。

原因以及解决办法:

是因为 Nunjucks 语法冲突了,当你的文章里有类似 {{ }} {% %} 这种或者其他的语法,就会报错,因为冲突了。

所以解决办法就是删掉类似的内容,换一种方式表达。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.