Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

小白不会搞(求助 #165

Open
for-the-zero opened this issue Jan 30, 2023 · 2 comments
Open

小白不会搞(求助 #165

for-the-zero opened this issue Jan 30, 2023 · 2 comments

Comments

@for-the-zero
Copy link

不知为啥,就是报错很多


_config.zip

↑里面有我的hexo配置和主题配置,别的基本上没改

hexo s的输出:

$ hexo s
INFO  Validating config
INFO  Start processing
INFO  Hexo is running at http://localhost:4000/ . Press Ctrl+C to stop.
ERROR Render HTML failed: index.html
TypeError: E:\Blog\themes\pure\layout\layout.ejs:3
    1| <!DOCTYPE html>
    2| <html<%= config.language ? " lang=" + config.language.substring(0, 2) : ""%>>
 >> 3| <%- partial('_common/head', {post: page}) %>
    4| <%
    5|  var bodyClass = 'main-center';
    6|  if (theme.config.layout) {

E:\Blog\themes\pure\layout\_common\head.ejs:3
    1| <head>
    2|   <meta charset="utf-8">
 >> 3|   <% if (theme.douban.user && page.layout === 'books') { %>
    4|   <meta name="referrer" content="never">
    5|   <% } %>
    6|   <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">

Cannot read properties of undefined (reading 'user')
    at eval ("E:\\Blog\\themes\\pure\\layout\\_common\\head.ejs":12:25)
    at head (E:\Blog\node_modules\ejs\lib\ejs.js:703:17)
    at _View._compiledSync (E:\Blog\node_modules\hexo\lib\theme\view.js:132:24)
    at _View.renderSync (E:\Blog\node_modules\hexo\lib\theme\view.js:59:25)
    at Object.partial (E:\Blog\node_modules\hexo\lib\plugins\helper\partial.js:34:15)
    at eval ("E:\\Blog\\themes\\pure\\layout\\layout.ejs":15:17)
    at layout (E:\Blog\node_modules\ejs\lib\ejs.js:703:17)
    at _View._compiled (E:\Blog\node_modules\hexo\lib\theme\view.js:136:50)
    at _View.render (E:\Blog\node_modules\hexo\lib\theme\view.js:39:17)
    at E:\Blog\node_modules\hexo\lib\theme\view.js:51:25
    at tryCatcher (E:\Blog\node_modules\bluebird\js\release\util.js:16:23)
    at Promise._settlePromiseFromHandler (E:\Blog\node_modules\bluebird\js\release\promise.js:547:31)
    at Promise._settlePromise (E:\Blog\node_modules\bluebird\js\release\promise.js:604:18)
    at Promise._settlePromise0 (E:\Blog\node_modules\bluebird\js\release\promise.js:649:10)
    at Promise._settlePromises (E:\Blog\node_modules\bluebird\js\release\promise.js:729:18)
    at _drainQueueStep (E:\Blog\node_modules\bluebird\js\release\async.js:93:12)
    at _drainQueue (E:\Blog\node_modules\bluebird\js\release\async.js:86:9)
    at Async._drainQueues (E:\Blog\node_modules\bluebird\js\release\async.js:102:5)
    at Immediate.Async.drainQueues [as _onImmediate] (E:\Blog\node_modules\bluebird\js\release\async.js:15:14)
    at processImmediate (node:internal/timers:466:21)
Unhandled rejection TypeError: E:\Blog\themes\pure\layout\layout.ejs:3
    1| <!DOCTYPE html>
    2| <html<%= config.language ? " lang=" + config.language.substring(0, 2) : ""%>>
 >> 3| <%- partial('_common/head', {post: page}) %>
    4| <%
    5|  var bodyClass = 'main-center';
    6|  if (theme.config.layout) {

E:\Blog\themes\pure\layout\_common\head.ejs:3
    1| <head>
    2|   <meta charset="utf-8">
 >> 3|   <% if (theme.douban.user && page.layout === 'books') { %>
    4|   <meta name="referrer" content="never">
    5|   <% } %>
    6|   <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">

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

INFO  Farewell
@for-the-zero
Copy link
Author

hexo g报错

  1. ERROR Render HTML failed: xxx.html
  2. TypeError: E:\Blog\themes\pure\layout\layout.ejs:3

@ixoywell
Copy link

ixoywell commented Feb 8, 2023

都提示了:Cannot read properties of undefined (reading 'user')
是不是把主题配置文件_config.yml下的douban.user配置给删了。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants