blinkfox / hexo-theme-matery

A beautiful hexo blog theme with material design and responsive design.一个基于材料设计和响应式设计而成的全面、美观的Hexo主题。国内访问:http://blinkfox.com
https://blinkfox.github.io/
Apache License 2.0
5.24k stars 1.25k forks source link

新建的文章 为什么打不开?报错如下 #241

Closed AIrobot6 closed 4 years ago

AIrobot6 commented 4 years ago

Unhandled rejection ReferenceError: D:\ok\themes\hexo-theme-matery\layout\post.ejs:26 24| 25| <% if (isTocEnable) { %>

26| <%- partial('_partial/post-detail-toc.ejs') %> 27| <% } else { %> 28| <%- partial('_partial/post-detail.ejs') %> 29| <% } %>

D:\ok\themes\hexo-theme-matery\layout_partial\post-detail-toc.ejs:90 88|

89|

90| <%- partial('_partial/post-detail.ejs') %> 91|

92|
93|

D:\ok\themes\hexo-theme-matery\layout_partial\post-detail.ejs:53 51|

52| <%- __('wordCount') %>:  

53| <%= wordcount(page.content) %> 54|

55| <% } %> 56|

wordcount is not defined at eval (D:\ok\themes\hexo-theme-matery\layout_partial\post-detail.ejs:84:7) at post-detail (D:\ok\node_modules\ejs\lib\ejs.js:682:17) at Theme._View.View._compiledSync (D:\ok\node_modules\hexo\lib\theme\view.js:119:22) at Theme._View.View.View.renderSync (D:\ok\node_modules\hexo\lib\theme\view.js:48:23) at Object.partial (D:\ok\node_modules\hexo\lib\plugins\helper\partial.js:34:15) at eval (D:\ok\themes\hexo-theme-matery\layout_partial\post-detail-toc.ejs:14:17) at post-detail-toc (D:\ok\node_modules\ejs\lib\ejs.js:682:17) at Theme._View.View._compiledSync (D:\ok\node_modules\hexo\lib\theme\view.js:119:22) at Theme._View.View.View.renderSync (D:\ok\node_modules\hexo\lib\theme\view.js:48:23) at Object.partial (D:\ok\node_modules\hexo\lib\plugins\helper\partial.js:34:15) at eval (D:\ok\themes\hexo-theme-matery\layout\post.ejs:47:17) at post (D:\ok\node_modules\ejs\lib\ejs.js:682:17) at Theme._View.View._compiled (D:\ok\node_modules\hexo\lib\theme\view.js:123:48) at Theme._View.View.View.render (D:\ok\node_modules\hexo\lib\theme\view.js:29:15) at D:\ok\node_modules\hexo\lib\hexo\index.js:365:21 at tryCatcher (D:\ok\node_modules\bluebird\js\release\util.js:16:23) at D:\ok\node_modules\bluebird\js\release\method.js:15:34 at RouteStream._read (D:\ok\node_modules\hexo\lib\hexo\router.js:123:3) at RouteStream.Readable.read (_streamreadable.js:490:10) at resume (_stream_readable.js:975:12) at processTicksAndRejections (internal/process/task_queues.js:80:21)

blinkfox commented 4 years ago

应该需要安装 hexo-wordcount 插件。

npm i --save hexo-wordcount
blinkfox commented 4 years ago

新版本 v1.2.2 已经做了些判断,不安装 hexo-wordcount 应该也不会报错了。