Candinya / Kratos-Rebirth

一个可爱而现代的 Hexo 主题
GNU General Public License v3.0
640 stars 81 forks source link

这是一个问题 #15

Closed lonelyzou closed 4 years ago

lonelyzou commented 4 years ago

ERROR { err: TypeError: E:\LonelyZhou_Bolg\themes\Kratos-Rebirth\layout\layout.ejs:1

1| <%- partial('_partial/head') %> 2| <%- partial('_partial/header') %> 3|

4| <%- body %>

E:\LonelyZhou_Bolg\themes\Kratos-Rebirth\layout_partial\head.ejs:45 43|
44|

45| <% if (theme.contact.twitter) { %> 46| 47| 48|

Cannot read property 'twitter' of undefined at eval (E:\LonelyZhou_Bolg\themes\Kratos-Rebirth\layout_partial\head.ejs:115:26)
at head (E:\LonelyZhou_Bolg\node_modules\ejs\lib\ejs.js:682:17) at _View._compiledSync (E:\LonelyZhou_Bolg\node_modules\hexo\lib\theme\view.js:132:24)
at _View.renderSync (E:\LonelyZhou_Bolg\node_modules\hexo\lib\theme\view.js:59:25)
at Object.partial (E:\LonelyZhou_Bolg\node_modules\hexo\lib\plugins\helper\partial.js:34:15) at eval (E:\LonelyZhou_Bolg\themes\Kratos-Rebirth\layout\layout.ejs:10:17) at layout (E:\LonelyZhou_Bolg\node_modules\ejs\lib\ejs.js:682:17) at _View._compiled (E:\LonelyZhou_Bolg\node_modules\hexo\lib\theme\view.js:136:50)
at _View.render (E:\LonelyZhou_Bolg\node_modules\hexo\lib\theme\view.js:39:17) at E:\LonelyZhou_Bolg\node_modules\hexo\lib\theme\view.js:51:25 at tryCatcher (E:\LonelyZhou_Bolg\node_modules\bluebird\js\release\util.js:16:23)
at Promise._settlePromiseFromHandler (E:\LonelyZhou_Bolg\node_modules\bluebird\js\release\promise.js:547:31) at Promise._settlePromise (E:\LonelyZhou_Bolg\node_modules\bluebird\js\release\promise.js:604:18) at Promise._settlePromise0 (E:\LonelyZhou_Bolg\node_modules\bluebird\js\release\promise.js:649:10) at Promise._settlePromises (E:\LonelyZhou_Bolg\node_modules\bluebird\js\release\promise.js:729:18) at _drainQueueStep (E:\LonelyZhou_Bolg\node_modules\bluebird\js\release\async.js:93:12) at _drainQueue (E:\LonelyZhou_Bolg\node_modules\bluebird\js\release\async.js:86:9)
at Async._drainQueues (E:\LonelyZhou_Bolg\node_modules\bluebird\js\release\async.js:102:5) at Immediate.Async.drainQueues [as _onImmediate] (E:\LonelyZhou_Bolg\node_modules\bluebird\js\release\async.js:15:14) at processImmediate (internal/timers.js:439:21) { path: 'E:\LonelyZhou_Bolg\themes\Kratos-Rebirth\layout\layout.ejs' } } Render HTML failed: index.html Unhandled rejection TypeError: E:\LonelyZhou_Bolg\themes\Kratos-Rebirth\layout\layout.ejs:1

1| <%- partial('_partial/head') %> 2| <%- partial('_partial/header') %> 3|

4| <%- body %>

E:\LonelyZhou_Bolg\themes\Kratos-Rebirth\layout_partial\head.ejs:45 43|
44|

45| <% if (theme.contact.twitter) { %> 46| 47| 48|

Cannot read property 'twitter' of undefined at eval (E:\LonelyZhou_Bolg\themes\Kratos-Rebirth\layout_partial\head.ejs:115:26)
at head (E:\LonelyZhou_Bolg\node_modules\ejs\lib\ejs.js:682:17) at _View._compiledSync (E:\LonelyZhou_Bolg\node_modules\hexo\lib\theme\view.js:132:24)
at _View.renderSync (E:\LonelyZhou_Bolg\node_modules\hexo\lib\theme\view.js:59:25)
at Object.partial (E:\LonelyZhou_Bolg\node_modules\hexo\lib\plugins\helper\partial.js:34:15) at eval (E:\LonelyZhou_Bolg\themes\Kratos-Rebirth\layout\layout.ejs:10:17) at layout (E:\LonelyZhou_Bolg\node_modules\ejs\lib\ejs.js:682:17) at _View._compiled (E:\LonelyZhou_Bolg\node_modules\hexo\lib\theme\view.js:136:50)
at _View.render (E:\LonelyZhou_Bolg\node_modules\hexo\lib\theme\view.js:39:17) at E:\LonelyZhou_Bolg\node_modules\hexo\lib\theme\view.js:51:25 at tryCatcher (E:\LonelyZhou_Bolg\node_modules\bluebird\js\release\util.js:16:23) at Promise._settlePromiseFromHandler (E:\LonelyZhou_Bolg\node_modules\bluebird\js\release\promise.js:547:31) at Promise._settlePromise (E:\LonelyZhou_Bolg\node_modules\bluebird\js\release\promise.js:604:18) at Promise._settlePromise0 (E:\LonelyZhou_Bolg\node_modules\bluebird\js\release\promise.js:649:10) at Promise._settlePromises (E:\LonelyZhou_Bolg\node_modules\bluebird\js\release\promise.js:729:18) at _drainQueueStep (E:\LonelyZhou_Bolg\node_modules\bluebird\js\release\async.js:93:12)
at _drainQueue (E:\LonelyZhou_Bolg\node_modules\bluebird\js\release\async.js:86:9)
at Async._drainQueues (E:\LonelyZhou_Bolg\node_modules\bluebird\js\release\async.js:102:5) at Immediate.Async.drainQueues [as _onImmediate] (E:\LonelyZhou_Bolg\node_modules\bluebird\js\release\async.js:15:14) at processImmediate (internal/timers.js:439:21)

vensing commented 4 years ago

如果您的主题目录下存在 _config.yml 文件,请确保 contact 配置变量存在;若不存在 _config.yml 文件,请尝试将您主题文件夹下的 _config.yml.example 文件,复制一份命名为 _config.yml。

Candinya commented 4 years ago

是主题配置里面的contact字段没有设置完成吗,这里指的是theme.contact主题配置文件-contact字段)没有定义 也是,我应该加一个contact的先手判断进去的,可以先检查一下主题配置文件的contact字段哦 以及项目目前提供的是配置文件的样例,需要复制一下删除掉最后的.example扩展名后缀的说

lonelyzou commented 4 years ago

可以了,建议备注下主题文件需要一个 _config.yml文件,像我这种小白都不晓得怎么搞嘞

Candinya commented 4 years ago

我好像确实忘了写明要把配置文件单独复制出来一份了🤣

vensing commented 4 years ago

项目 READEME 中有写到这个喔😄。

Candinya commented 4 years ago

项目 READEME 中有写到这个喔😄。

我忘记写了,Readme里面只提到了站点配置内容(被打