fooying / hexo-theme-xoxo-plus

Hexo theme for https://www.fooying.com, modification based on hexo-theme-xoxo
43 stars 18 forks source link

主题安装后hexo s报错是怎么回事啊 #4

Closed zlxFTH closed 1 year ago

zlxFTH commented 3 years ago

rt

zlxFTH commented 3 years ago

安装了hexo-reading-time还是有问题

zlxFTH commented 3 years ago

安装了hexo-reading-time还是有问题

ghost commented 3 years ago
是这个错误🐴?
Unhandled rejection ReferenceError: /Users/xfei/Blog/tlcy_github_io/themes/hexo-theme-xoxo-plus/layout/layout.ejs:8
shuhaoc commented 3 years ago
是这个错误🐴?
Unhandled rejection ReferenceError: /Users/xfei/Blog/tlcy_github_io/themes/hexo-theme-xoxo-plus/layout/layout.ejs:8

+1

zlxFTH commented 3 years ago
是这个错误🐴?
Unhandled rejection ReferenceError: /Users/xfei/Blog/tlcy_github_io/themes/hexo-theme-xoxo-plus/layout/layout.ejs:8

是的

zlxFTH commented 3 years ago

怎么办啊

imelonkid commented 1 year ago

一样的问题

imelonkid commented 1 year ago

感觉这个主题作者不在维护了

fooying commented 1 year ago

如果报错信息是

Unhandled rejection ReferenceError: /Volumes/fooying/dev/test/themes/hexo-theme-xoxo-plus/layout/layout.ejs:8
    6| <body>
    7|   <div class="nav-container">
 >> 8|     <%-partial('partials/nav')%>
    9|   </div>
    10|
    11|   <div class="container" id="content-outer">

/Volumes/fooying/dev/test/themes/hexo-theme-xoxo-plus/layout/partials/nav.ejs:11
    9|   <ul class="pure-menu-list clearfix">
    10|       <% Object.keys(theme.menu).forEach(function(key) { %>
 >> 11|           <% if (_.isPlainObject(theme.menu[key])) { %>
    12|             <% if (_.indexOf(Object.values(theme.menu[key]), '/'+page.path.split('/')[0]) != -1) { %>
    13|               <li class="pure-menu-item pure-menu-has-children pure-menu-allow-hover actived">
    14|             <% } else { %>

_ is not defined

主要是hexo更新新版本后,有一些库没有默认引用了,改为了原生JS操作,解决方案: 修改模板目录下文件:layout/partials/nav.ejs

11行 <% if (Object.prototype.toString.call(theme.menu[key]) === '[object Object]') { %>
12行 <% if (Object.values(theme.menu[key]).indexOf('/'+page.path.split('/')[0]) != -1) { %>

已将fix提交到仓库,更新模板也可以

imelonkid commented 1 year ago

如果报错信息是

Unhandled rejection ReferenceError: /Volumes/fooying/dev/test/themes/hexo-theme-xoxo-plus/layout/layout.ejs:8
    6| <body>
    7|   <div class="nav-container">
 >> 8|     <%-partial('partials/nav')%>
    9|   </div>
    10|
    11|   <div class="container" id="content-outer">

/Volumes/fooying/dev/test/themes/hexo-theme-xoxo-plus/layout/partials/nav.ejs:11
    9|   <ul class="pure-menu-list clearfix">
    10|       <% Object.keys(theme.menu).forEach(function(key) { %>
 >> 11|           <% if (_.isPlainObject(theme.menu[key])) { %>
    12|             <% if (_.indexOf(Object.values(theme.menu[key]), '/'+page.path.split('/')[0]) != -1) { %>
    13|               <li class="pure-menu-item pure-menu-has-children pure-menu-allow-hover actived">
    14|             <% } else { %>

_ is not defined

主要是hexo更新新版本后,有一些库没有默认引用了,改为了原生JS操作,解决方案: 修改模板目录下文件:layout/partials/nav.ejs

11行 <% if (Object.prototype.toString.call(theme.menu[key]) === '[object Object]') { %>
12行 <% if (Object.values(theme.menu[key]).indexOf('/'+page.path.split('/')[0]) != -1) { %>

已将fix提交到仓库,更新模板也可以

点赞,我今天试试

imelonkid commented 1 year ago

主页面可以进来了,但是点文章详情的时候报错了 ` Unhandled rejection ReferenceError: /Users/melonkid/Workspace/myself/melon-blog/themes/hexo-theme-xoxo-plus/layout/post.ejs:28 26| 27| /

28| 阅读耗时 <%=readingTime(page.content, '分钟') %> 29| 30| 31|

readingTime is not defined at eval (/Users/melonkid/Workspace/myself/melon-blog/themes/hexo-theme-xoxo-plus/layout/post.ejs:34:7) at post (/Users/melonkid/Workspace/myself/melon-blog/node_modules/ejs/lib/ejs.js:682:17) at _View._compiled (/Users/melonkid/Workspace/myself/melon-blog/node_modules/hexo/lib/theme/view.js:136:50) at _View.render (/Users/melonkid/Workspace/myself/melon-blog/node_modules/hexo/lib/theme/view.js:39:17) at /Users/melonkid/Workspace/myself/melon-blog/node_modules/hexo/lib/hexo/index.js:64:21 at tryCatcher (/Users/melonkid/Workspace/myself/melon-blog/node_modules/bluebird/js/release/util.js:16:23) at /Users/melonkid/Workspace/myself/melon-blog/node_modules/bluebird/js/release/method.js:15:34 at RouteStream._read (/Users/melonkid/Workspace/myself/melon-blog/nodemodules/hexo/lib/hexo/router.js:47:5) at RouteStream.Readable.read (node:internal/streams/readable:487:10) at resume (node:internal/streams/readable:987:12) at processTicksAndRejections (node:internal/process/task_queues:83:21)

Unhandled rejection ReferenceError: /Users/melonkid/Workspace/myself/melon-blog/themes/hexo-theme-xoxo-plus/layout/post.ejs:28 26| 27| /

28| 阅读耗时 <%=readingTime(page.content, '分钟') %> 29| 30| 31|

readingTime is not defined at eval (/Users/melonkid/Workspace/myself/melon-blog/themes/hexo-theme-xoxo-plus/layout/post.ejs:34:7) at post (/Users/melonkid/Workspace/myself/melon-blog/node_modules/ejs/lib/ejs.js:682:17) at _View._compiled (/Users/melonkid/Workspace/myself/melon-blog/node_modules/hexo/lib/theme/view.js:136:50) at _View.render (/Users/melonkid/Workspace/myself/melon-blog/node_modules/hexo/lib/theme/view.js:39:17) at /Users/melonkid/Workspace/myself/melon-blog/node_modules/hexo/lib/hexo/index.js:64:21 at tryCatcher (/Users/melonkid/Workspace/myself/melon-blog/node_modules/bluebird/js/release/util.js:16:23) at /Users/melonkid/Workspace/myself/melon-blog/node_modules/bluebird/js/release/method.js:15:34 at RouteStream._read (/Users/melonkid/Workspace/myself/melon-blog/nodemodules/hexo/lib/hexo/router.js:47:5) at RouteStream.Readable.read (node:internal/streams/readable:487:10) at resume (node:internal/streams/readable:987:12) at processTicksAndRejections (node:internal/process/task_queues:83:21) `

imelonkid commented 1 year ago

Unhandled rejection ReferenceError: /Users/melonkid/Workspace/myself/melon-blog/themes/hexo-theme-xoxo-plus/layout/post.ejs:28 26| 27| /

28| 阅读耗时 <%=readingTime(page.content, '分钟') %> 29| 30| 31|

readingTime is not defined at eval (/Users/melonkid/Workspace/myself/melon-blog/themes/hexo-theme-xoxo-plus/layout/post.ejs:34:7) at post (/Users/melonkid/Workspace/myself/melon-blog/node_modules/ejs/lib/ejs.js:682:17) at _View._compiled (/Users/melonkid/Workspace/myself/melon-blog/node_modules/hexo/lib/theme/view.js:136:50) at _View.render (/Users/melonkid/Workspace/myself/melon-blog/node_modules/hexo/lib/theme/view.js:39:17) at /Users/melonkid/Workspace/myself/melon-blog/node_modules/hexo/lib/hexo/index.js:64:21 at tryCatcher (/Users/melonkid/Workspace/myself/melon-blog/node_modules/bluebird/js/release/util.js:16:23) at /Users/melonkid/Workspace/myself/melon-blog/node_modules/bluebird/js/release/method.js:15:34 at RouteStream._read (/Users/melonkid/Workspace/myself/melon-blog/nodemodules/hexo/lib/hexo/router.js:47:5) at RouteStream.Readable.read (node:internal/streams/readable:487:10) at resume (node:internal/streams/readable:987:12) at processTicksAndRejections (node:internal/process/task_queues:83:21)

Unhandled rejection ReferenceError: /Users/melonkid/Workspace/myself/melon-blog/themes/hexo-theme-xoxo-plus/layout/post.ejs:28 26| 27| /

28| 阅读耗时 <%=readingTime(page.content, '分钟') %> 29| 30| 31|

readingTime is not defined at eval (/Users/melonkid/Workspace/myself/melon-blog/themes/hexo-theme-xoxo-plus/layout/post.ejs:34:7) at post (/Users/melonkid/Workspace/myself/melon-blog/node_modules/ejs/lib/ejs.js:682:17) at _View._compiled (/Users/melonkid/Workspace/myself/melon-blog/node_modules/hexo/lib/theme/view.js:136:50) at _View.render (/Users/melonkid/Workspace/myself/melon-blog/node_modules/hexo/lib/theme/view.js:39:17) at /Users/melonkid/Workspace/myself/melon-blog/node_modules/hexo/lib/hexo/index.js:64:21 at tryCatcher (/Users/melonkid/Workspace/myself/melon-blog/node_modules/bluebird/js/release/util.js:16:23) at /Users/melonkid/Workspace/myself/melon-blog/node_modules/bluebird/js/release/method.js:15:34 at RouteStream._read (/Users/melonkid/Workspace/myself/melon-blog/nodemodules/hexo/lib/hexo/router.js:47:5) at RouteStream.Readable.read (node:internal/streams/readable:487:10) at resume (node:internal/streams/readable:987:12) at processTicksAndRejections (node:internal/process/task_queues:83:21)

fooying commented 1 year ago

readingTime is not defined问题请先在模板目录下执行npm install 安装hexo-reading-time