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.23k stars 1.25k forks source link

can not open article when clicking #268

Closed tt1k closed 4 years ago

tt1k commented 4 years ago

here is the console output when excuting "hexo server":

Unhandled rejection ReferenceError: D:\tcl\Writting\IcedOtaku.github.io\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:\tcl\Writting\IcedOtaku.github.io\themes\hexo-theme-matery\layout\_partial\post-detail-toc.ejs:96
    94| <div class="row">
    95|     <div id="main-content" class="col s12 m12 l9">
 >> 96|         <%- partial('_partial/post-detail.ejs') %>
    97|     </div>
    98|     <div id="toc-aside" class="expanded col l3 hide-on-med-and-down">
    99|         <div class="toc-widget">

D:\tcl\Writting\IcedOtaku.github.io\themes\hexo-theme-matery\layout\_partial\post-detail.ejs:60
    58|                 <div class="info-break-policy">
    59|                     <i class="far fa-clock fa-fw"></i><%- __('readTimes') %>:&nbsp;&nbsp;
 >> 60|                     <%= min2read(page.content) %> <%= __('Minutes') %>
    61|                 </div>
    62|                 <% } %>
    63|

min2read is not defined
    at eval (D:\tcl\Writting\IcedOtaku.github.io\themes\hexo-theme-matery\layout\_partial\post-detail.ejs:96:7)
    at post-detail (D:\tcl\Writting\IcedOtaku.github.io\node_modules\ejs\lib\ejs.js:682:17)
    at Theme._View.View._compiledSync (D:\tcl\Writting\IcedOtaku.github.io\node_modules\hexo\lib\theme\view.js:119:22)
    at Theme._View.View.View.renderSync (D:\tcl\Writting\IcedOtaku.github.io\node_modules\hexo\lib\theme\view.js:48:23)
    at Object.partial (D:\tcl\Writting\IcedOtaku.github.io\node_modules\hexo\lib\plugins\helper\partial.js:34:15)
    at eval (D:\tcl\Writting\IcedOtaku.github.io\themes\hexo-theme-matery\layout\_partial\post-detail-toc.ejs:14:17)
    at post-detail-toc (D:\tcl\Writting\IcedOtaku.github.io\node_modules\ejs\lib\ejs.js:682:17)
    at Theme._View.View._compiledSync (D:\tcl\Writting\IcedOtaku.github.io\node_modules\hexo\lib\theme\view.js:119:22)
    at Theme._View.View.View.renderSync (D:\tcl\Writting\IcedOtaku.github.io\node_modules\hexo\lib\theme\view.js:48:23)
    at Object.partial (D:\tcl\Writting\IcedOtaku.github.io\node_modules\hexo\lib\plugins\helper\partial.js:34:15)
    at eval (D:\tcl\Writting\IcedOtaku.github.io\themes\hexo-theme-matery\layout\post.ejs:47:17)
    at post (D:\tcl\Writting\IcedOtaku.github.io\node_modules\ejs\lib\ejs.js:682:17)
    at Theme._View.View._compiled (D:\tcl\Writting\IcedOtaku.github.io\node_modules\hexo\lib\theme\view.js:123:48)
    at Theme._View.View.View.render (D:\tcl\Writting\IcedOtaku.github.io\node_modules\hexo\lib\theme\view.js:29:15)
    at D:\tcl\Writting\IcedOtaku.github.io\node_modules\hexo\lib\hexo\index.js:365:21
    at tryCatcher (D:\tcl\Writting\IcedOtaku.github.io\node_modules\bluebird\js\release\util.js:16:23)
    at D:\tcl\Writting\IcedOtaku.github.io\node_modules\bluebird\js\release\method.js:15:34
    at RouteStream._read (D:\tcl\Writting\IcedOtaku.github.io\node_modules\hexo\lib\hexo\router.js:123:3)
    at RouteStream.Readable.read (_stream_readable.js:486:10)
    at resume_ (_stream_readable.js:970:12)
    at processTicksAndRejections (internal/process/task_queues.js:77:11)

and I find out the reason that may caused this is because I did not install hexo-wordcount for my hexo repo. just "npm install hexo-wordcount" is fine. maybe u should install hexo-wordcount automatically at user's first use.

blinkfox commented 4 years ago

嗯,很多地方都用到了 word-count,,默认配置里面开启了它,配置文件里面可以设置关闭它,后续文档上会写明建议安装此插件。