jerryc127 / hexo-theme-butterfly

🦋 A Hexo Theme: Butterfly
https://butterfly.js.org
Apache License 2.0
7.29k stars 1.3k forks source link

[Bug]: 更改主题配置文件后构建出错(好像和wordcount和pace有关) #1315

Closed Lynricsy closed 1 year ago

Lynricsy commented 1 year ago

使用的 Butterfly 版本? | What version of Butterfly are you use?

4.9.0

是否修改过主题文件? || Has the theme files been modified?

是 (Yes)

使用的瀏覽器? || What browse are you using?

Edge

使用的系統? || What operating system are you using?

Linux

問題描述 | Describe the bug

更改主题配置文件后构建出错 如果开启wordcount:

ERROR
TypeError: /home/lynrics/LynBlog/themes/butterfly/layout/includes/header/post-info.pug:47
    45|             i.far.fa-file-word.fa-fw.post-meta-icon
    46|             span.post-meta-label= _p('post.wordcount') + ':'
  > 47|             span.word-count= wordcount(page.content)
    48|             if theme.wordcount.min2read
    49|               span.post-meta-separator |
    50|           if theme.wordcount.min2read

wordcount is not a function
    at eval (eval at wrap (/home/lynrics/node_modules/pug-runtime/wrap.js:6:10), <anonymous>:501:57)
    at template (eval at wrap (/home/lynrics/node_modules/pug-runtime/wrap.js:6:10), <anonymous>:5403:7)
    at _View._compiled (/home/lynrics/LynBlog/node_modules/hexo/lib/theme/view.js:136:50)
    at _View.render (/home/lynrics/LynBlog/node_modules/hexo/lib/theme/view.js:39:17)
    at /home/lynrics/LynBlog/node_modules/hexo/lib/hexo/index.js:64:21
    at tryCatcher (/home/lynrics/LynBlog/node_modules/bluebird/js/release/util.js:16:23)
    at /home/lynrics/LynBlog/node_modules/bluebird/js/release/method.js:15:34
    at RouteStream._read (/home/lynrics/LynBlog/node_modules/hexo/lib/hexo/router.js:47:5)
    at Readable.read (node:internal/streams/readable:504:12)
    at resume_ (node:internal/streams/readable:1007:12)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
ERROR
TypeError: /home/lynrics/LynBlog/themes/butterfly/layout/includes/widget/index.pug:33
    31|       !=partial('includes/widget/card_tags', {}, {cache: true})
    32|       !=partial('includes/widget/card_archives', {}, {cache: true})
  > 33|       !=partial('includes/widget/card_webinfo', {}, {cache: true})
    34|       !=partial('includes/widget/card_bottom_self', {}, {cache: true})

/home/lynrics/LynBlog/themes/butterfly/layout/includes/widget/card_webinfo.pug:19
    17|         .webinfo-item
    18|           .item-name=_p('aside.card_webinfo.site_wordcount') + " :"
  > 19|           .item-count=totalcount(site)
    20|       if theme.busuanzi.site_uv
    21|         .webinfo-item
    22|           .item-name= _p('aside.card_webinfo.site_uv_name') + " :"

totalcount is not a function
    at eval (eval at wrap (/home/lynrics/node_modules/pug-runtime/wrap.js:6:10), <anonymous>:58:57)
    at template (eval at wrap (/home/lynrics/node_modules/pug-runtime/wrap.js:6:10), <anonymous>:101:7)
    at _View._compiledSync (/home/lynrics/LynBlog/node_modules/hexo/lib/theme/view.js:132:24)
    at _View.renderSync (/home/lynrics/LynBlog/node_modules/hexo/lib/theme/view.js:59:25)
    at /home/lynrics/LynBlog/node_modules/hexo/lib/plugins/helper/partial.js:31:52
    at Cache.apply (/home/lynrics/LynBlog/node_modules/hexo-util/lib/cache.js:27:46)
    at Object.fragmentCache (/home/lynrics/LynBlog/node_modules/hexo/lib/plugins/helper/fragment_cache.js:11:34)
    at Object.partial (/home/lynrics/LynBlog/node_modules/hexo/lib/plugins/helper/partial.js:31:17)
    at eval (eval at wrap (/home/lynrics/node_modules/pug-runtime/wrap.js:6:10), <anonymous>:1135:46)
    at template (eval at wrap (/home/lynrics/node_modules/pug-runtime/wrap.js:6:10), <anonymous>:4900:7)
    at _View._compiled (/home/lynrics/LynBlog/node_modules/hexo/lib/theme/view.js:136:50)
    at _View.render (/home/lynrics/LynBlog/node_modules/hexo/lib/theme/view.js:39:17)
    at /home/lynrics/LynBlog/node_modules/hexo/lib/hexo/index.js:64:21
    at tryCatcher (/home/lynrics/LynBlog/node_modules/bluebird/js/release/util.js:16:23)
    at /home/lynrics/LynBlog/node_modules/bluebird/js/release/method.js:15:34
    at RouteStream._read (/home/lynrics/LynBlog/node_modules/hexo/lib/hexo/router.js:47:5)
    at Readable.read (node:internal/streams/readable:504:12)
    at resume_ (node:internal/streams/readable:1007:12)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
ERROR
TypeError: /home/lynrics/LynBlog/themes/butterfly/layout/includes/widget/index.pug:33
    31|       !=partial('includes/widget/card_tags', {}, {cache: true})
    32|       !=partial('includes/widget/card_archives', {}, {cache: true})
  > 33|       !=partial('includes/widget/card_webinfo', {}, {cache: true})
    34|       !=partial('includes/widget/card_bottom_self', {}, {cache: true})

/home/lynrics/LynBlog/themes/butterfly/layout/includes/widget/card_webinfo.pug:19
    17|         .webinfo-item
    18|           .item-name=_p('aside.card_webinfo.site_wordcount') + " :"
  > 19|           .item-count=totalcount(site)
    20|       if theme.busuanzi.site_uv
    21|         .webinfo-item
    22|           .item-name= _p('aside.card_webinfo.site_uv_name') + " :"

totalcount is not a function
    at eval (eval at wrap (/home/lynrics/node_modules/pug-runtime/wrap.js:6:10), <anonymous>:58:57)
    at template (eval at wrap (/home/lynrics/node_modules/pug-runtime/wrap.js:6:10), <anonymous>:101:7)
    at _View._compiledSync (/home/lynrics/LynBlog/node_modules/hexo/lib/theme/view.js:132:24)
    at _View.renderSync (/home/lynrics/LynBlog/node_modules/hexo/lib/theme/view.js:59:25)
    at /home/lynrics/LynBlog/node_modules/hexo/lib/plugins/helper/partial.js:31:52
    at Cache.apply (/home/lynrics/LynBlog/node_modules/hexo-util/lib/cache.js:27:46)
    at Object.fragmentCache (/home/lynrics/LynBlog/node_modules/hexo/lib/plugins/helper/fragment_cache.js:11:34)
    at Object.partial (/home/lynrics/LynBlog/node_modules/hexo/lib/plugins/helper/partial.js:31:17)
    at eval (eval at wrap (/home/lynrics/node_modules/pug-runtime/wrap.js:6:10), <anonymous>:1135:46)
    at template (eval at wrap (/home/lynrics/node_modules/pug-runtime/wrap.js:6:10), <anonymous>:4900:7)
    at _View._compiled (/home/lynrics/LynBlog/node_modules/hexo/lib/theme/view.js:136:50)
    at _View.render (/home/lynrics/LynBlog/node_modules/hexo/lib/theme/view.js:39:17)
    at /home/lynrics/LynBlog/node_modules/hexo/lib/hexo/index.js:64:21
    at tryCatcher (/home/lynrics/LynBlog/node_modules/bluebird/js/release/util.js:16:23)
    at /home/lynrics/LynBlog/node_modules/bluebird/js/release/method.js:15:34
    at RouteStream._read (/home/lynrics/LynBlog/node_modules/hexo/lib/hexo/router.js:47:5)
    at Readable.read (node:internal/streams/readable:504:12)
    at resume_ (node:internal/streams/readable:1007:12)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
ERROR
TypeError: /home/lynrics/LynBlog/themes/butterfly/layout/includes/widget/index.pug:33
    31|       !=partial('includes/widget/card_tags', {}, {cache: true})
    32|       !=partial('includes/widget/card_archives', {}, {cache: true})
  > 33|       !=partial('includes/widget/card_webinfo', {}, {cache: true})
    34|       !=partial('includes/widget/card_bottom_self', {}, {cache: true})

/home/lynrics/LynBlog/themes/butterfly/layout/includes/widget/card_webinfo.pug:19
    17|         .webinfo-item
    18|           .item-name=_p('aside.card_webinfo.site_wordcount') + " :"
  > 19|           .item-count=totalcount(site)
    20|       if theme.busuanzi.site_uv
    21|         .webinfo-item
    22|           .item-name= _p('aside.card_webinfo.site_uv_name') + " :"

totalcount is not a function
    at eval (eval at wrap (/home/lynrics/node_modules/pug-runtime/wrap.js:6:10), <anonymous>:58:57)
    at template (eval at wrap (/home/lynrics/node_modules/pug-runtime/wrap.js:6:10), <anonymous>:101:7)
    at _View._compiledSync (/home/lynrics/LynBlog/node_modules/hexo/lib/theme/view.js:132:24)
    at _View.renderSync (/home/lynrics/LynBlog/node_modules/hexo/lib/theme/view.js:59:25)
    at /home/lynrics/LynBlog/node_modules/hexo/lib/plugins/helper/partial.js:31:52
    at Cache.apply (/home/lynrics/LynBlog/node_modules/hexo-util/lib/cache.js:27:46)
    at Object.fragmentCache (/home/lynrics/LynBlog/node_modules/hexo/lib/plugins/helper/fragment_cache.js:11:34)
    at Object.partial (/home/lynrics/LynBlog/node_modules/hexo/lib/plugins/helper/partial.js:31:17)
    at eval (eval at wrap (/home/lynrics/node_modules/pug-runtime/wrap.js:6:10), <anonymous>:1135:46)
    at template (eval at wrap (/home/lynrics/node_modules/pug-runtime/wrap.js:6:10), <anonymous>:4900:7)
    at _View._compiled (/home/lynrics/LynBlog/node_modules/hexo/lib/theme/view.js:136:50)
    at _View.render (/home/lynrics/LynBlog/node_modules/hexo/lib/theme/view.js:39:17)
    at /home/lynrics/LynBlog/node_modules/hexo/lib/hexo/index.js:64:21
    at tryCatcher (/home/lynrics/LynBlog/node_modules/bluebird/js/release/util.js:16:23)
    at /home/lynrics/LynBlog/node_modules/bluebird/js/release/method.js:15:34
    at RouteStream._read (/home/lynrics/LynBlog/node_modules/hexo/lib/hexo/router.js:47:5)
    at Readable.read (node:internal/streams/readable:504:12)
    at resume_ (node:internal/streams/readable:1007:12)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
ERROR
TypeError: /home/lynrics/LynBlog/themes/butterfly/layout/includes/widget/index.pug:33
    31|       !=partial('includes/widget/card_tags', {}, {cache: true})
    32|       !=partial('includes/widget/card_archives', {}, {cache: true})
  > 33|       !=partial('includes/widget/card_webinfo', {}, {cache: true})
    34|       !=partial('includes/widget/card_bottom_self', {}, {cache: true})

/home/lynrics/LynBlog/themes/butterfly/layout/includes/widget/card_webinfo.pug:19
    17|         .webinfo-item
    18|           .item-name=_p('aside.card_webinfo.site_wordcount') + " :"
  > 19|           .item-count=totalcount(site)
    20|       if theme.busuanzi.site_uv
    21|         .webinfo-item
    22|           .item-name= _p('aside.card_webinfo.site_uv_name') + " :"

totalcount is not a function
    at eval (eval at wrap (/home/lynrics/node_modules/pug-runtime/wrap.js:6:10), <anonymous>:58:57)
    at template (eval at wrap (/home/lynrics/node_modules/pug-runtime/wrap.js:6:10), <anonymous>:101:7)
    at _View._compiledSync (/home/lynrics/LynBlog/node_modules/hexo/lib/theme/view.js:132:24)
    at _View.renderSync (/home/lynrics/LynBlog/node_modules/hexo/lib/theme/view.js:59:25)
    at /home/lynrics/LynBlog/node_modules/hexo/lib/plugins/helper/partial.js:31:52
    at Cache.apply (/home/lynrics/LynBlog/node_modules/hexo-util/lib/cache.js:27:46)
    at Object.fragmentCache (/home/lynrics/LynBlog/node_modules/hexo/lib/plugins/helper/fragment_cache.js:11:34)
    at Object.partial (/home/lynrics/LynBlog/node_modules/hexo/lib/plugins/helper/partial.js:31:17)
    at eval (eval at wrap (/home/lynrics/node_modules/pug-runtime/wrap.js:6:10), <anonymous>:1915:46)
    at template (eval at wrap (/home/lynrics/node_modules/pug-runtime/wrap.js:6:10), <anonymous>:5680:7)
    at _View._compiled (/home/lynrics/LynBlog/node_modules/hexo/lib/theme/view.js:136:50)
    at _View.render (/home/lynrics/LynBlog/node_modules/hexo/lib/theme/view.js:39:17)
    at /home/lynrics/LynBlog/node_modules/hexo/lib/hexo/index.js:64:21
    at tryCatcher (/home/lynrics/LynBlog/node_modules/bluebird/js/release/util.js:16:23)
    at /home/lynrics/LynBlog/node_modules/bluebird/js/release/method.js:15:34
    at RouteStream._read (/home/lynrics/LynBlog/node_modules/hexo/lib/hexo/router.js:47:5)
    at Readable.read (node:internal/streams/readable:504:12)
    at resume_ (node:internal/streams/readable:1007:12)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)

如果不开启wordcount:

ERROR Script load failed: themes/butterfly/scripts/loading-bar.css
/home/lynrics/LynBlog/themes/butterfly/scripts/loading-bar.css:1
(function(exports, require, module, __filename, __dirname, hexo){.pace {
                                                                 ^

SyntaxError: Unexpected token '.'
    at new Script (node:vm:94:7)
    at createScript (node:vm:250:10)
    at runInThisContext (node:vm:298:10)
    at /home/lynrics/LynBlog/node_modules/hexo/lib/hexo/index.js:303:18
    at tryCatcher (/home/lynrics/LynBlog/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/home/lynrics/LynBlog/node_modules/bluebird/js/release/promise.js:547:31)
    at Promise._settlePromise (/home/lynrics/LynBlog/node_modules/bluebird/js/release/promise.js:604:18)
    at Promise._settlePromise0 (/home/lynrics/LynBlog/node_modules/bluebird/js/release/promise.js:649:10)
    at Promise._settlePromises (/home/lynrics/LynBlog/node_modules/bluebird/js/release/promise.js:729:18)
    at _drainQueueStep (/home/lynrics/LynBlog/node_modules/bluebird/js/release/async.js:93:12)
    at _drainQueue (/home/lynrics/LynBlog/node_modules/bluebird/js/release/async.js:86:9)
    at Async._drainQueues (/home/lynrics/LynBlog/node_modules/bluebird/js/release/async.js:102:5)
    at Async.drainQueues [as _onImmediate] (/home/lynrics/LynBlog/node_modules/bluebird/js/release/async.js:15:14)
    at process.processImmediate (node:internal/timers:478:21)
ERROR Script load failed: themes/butterfly/scripts/loading-bar.css:Zone.Identifier
/home/lynrics/LynBlog/themes/butterfly/scripts/loading-bar.css:Zone.Identifier:3
HostUrl=https://codebyzach.github.io/
             ^

SyntaxError: Unexpected token ':'
    at new Script (node:vm:94:7)
    at createScript (node:vm:250:10)
    at runInThisContext (node:vm:298:10)
    at /home/lynrics/LynBlog/node_modules/hexo/lib/hexo/index.js:303:18
    at tryCatcher (/home/lynrics/LynBlog/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/home/lynrics/LynBlog/node_modules/bluebird/js/release/promise.js:547:31)
    at Promise._settlePromise (/home/lynrics/LynBlog/node_modules/bluebird/js/release/promise.js:604:18)
    at Promise._settlePromise0 (/home/lynrics/LynBlog/node_modules/bluebird/js/release/promise.js:649:10)
    at Promise._settlePromises (/home/lynrics/LynBlog/node_modules/bluebird/js/release/promise.js:729:18)
    at _drainQueueStep (/home/lynrics/LynBlog/node_modules/bluebird/js/release/async.js:93:12)
    at _drainQueue (/home/lynrics/LynBlog/node_modules/bluebird/js/release/async.js:86:9)
    at Async._drainQueues (/home/lynrics/LynBlog/node_modules/bluebird/js/release/async.js:102:5)
    at Async.drainQueues [as _onImmediate] (/home/lynrics/LynBlog/node_modules/bluebird/js/release/async.js:15:14)
    at process.processImmediate (node:internal/timers:478:21)

出現問題網站 | Website

Sorry,I haven't published it yet.

jerryc127 commented 1 year ago

问问题前能不能查一下是不是有人问过了 或者看文档呢? https://github.com/jerryc127/hexo-theme-butterfly/issues/354