Closed hcanyz closed 3 years ago
已修复。我本地无法复现,只能盲调了一下,烦请老铁看看是否有问题,谢谢!
还是有些问题
hexo init $,主题改成你这个,跑起来就能复现了。
{
err: Error: ~\themes\zhaoo\layout\layout.ejs:1
>> 1| <%- partial('_partial/head') %>
2| <body class="lock-screen">
3| <%- partial('_partial/components/loading') %>
4| <% if (theme.navbar.enable) { %>
Partial _partial/head does not exist. (in layout.ejs)
at Object.partial (~\node_modules\hexo\lib\plugins\helper\partial.js:16:11)
at eval (~\themes\zhaoo\layout\layout.ejs:8:17)
at layout (~\node_modules\ejs\lib\ejs.js:682:17)
at _View._compiled (~\node_modules\hexo\lib\theme\view.js:136:50)
at _View.render (~\node_modules\hexo\lib\theme\view.js:39:17)
at ~\node_modules\hexo\lib\theme\view.js:51:25
at tryCatcher (~\node_modules\bluebird\js\release\util.js:16:23)
at Promise._settlePromiseFromHandler (~\node_modules\bluebird\js\release\promise.js:547:31)
at Promise._settlePromise (~\node_modules\bluebird\js\release\promise.js:604:18)
at Promise._settlePromise0 (~\node_modules\bluebird\js\release\promise.js:649:10)
at Promise._settlePromises (~\node_modules\bluebird\js\release\promise.js:729:18)
at _drainQueueStep (~\node_modules\bluebird\js\release\async.js:93:12)
at _drainQueue (~\node_modules\bluebird\js\release\async.js:86:9)
at Async._drainQueues (~\node_modules\bluebird\js\release\async.js:102:5)
at Immediate.Async.drainQueues [as _onImmediate] (~\node_modules\bluebird\js\release\async.js:15:14)
at processImmediate (internal/timers.js:456:21) {
path: '~\\themes\\zhaoo\\layout\\layout.ejs'
}
} Render HTML failed: index.html
Unhandled rejection Error: ~\themes\zhaoo\layout\layout.ejs:1
>> 1| <%- partial('_partial/head') %>
2| <body class="lock-screen">
3| <%- partial('_partial/components/loading') %>
4| <% if (theme.navbar.enable) { %>
Partial _partial/head does not exist. (in layout.ejs)
at Object.partial (~\node_modules\hexo\lib\plugins\helper\partial.js:16:11)
at eval (~\themes\zhaoo\layout\layout.ejs:8:17)
at layout (~\node_modules\ejs\lib\ejs.js:682:17)
at _View._compiled (~\node_modules\hexo\lib\theme\view.js:136:50)
at _View.render (~\node_modules\hexo\lib\theme\view.js:39:17)
at ~\node_modules\hexo\lib\theme\view.js:51:25
at tryCatcher (~\node_modules\bluebird\js\release\util.js:16:23)
at Promise._settlePromiseFromHandler (~\node_modules\bluebird\js\release\promise.js:547:31)
at Promise._settlePromise (~\node_modules\bluebird\js\release\promise.js:604:18)
at Promise._settlePromise0 (~\node_modules\bluebird\js\release\promise.js:649:10)
at Promise._settlePromises (~\node_modules\bluebird\js\release\promise.js:729:18)
at _drainQueueStep (~\node_modules\bluebird\js\release\async.js:93:12)
at _drainQueue (~\node_modules\bluebird\js\release\async.js:86:9)
at Async._drainQueues (~\node_modules\bluebird\js\release\async.js:102:5)
at Immediate.Async.drainQueues [as _onImmediate] (~\node_modules\bluebird\js\release\async.js:15:14)
at processImmediate (internal/timers.js:456:21)
好滴。
~
path: '<%- config.search ? config.search.path : '' %>'
测试已修复。
path: '<%- config?.search?.path %>'
我这边还是有问题,访问页面报前面的错。 ?.
语法需要安装什么嘛?
那我改成你的三元语法吧。?.
是 ES7 的。
已修复。
https://github.com/zhaoo/hexo-theme-zhaoo/blob/99d5f3e8fb1c8052029bfa9b7652362f56ceeaf9/layout/_partial/head.ejs#L125 search null 时会导致编译后 json 结构错乱
search: {
enable: false,
path:
}
需要改为 `''`
hexo _config.yml 中缺少
运行时报错。
hexo version
error