Yue-plus / hexo-theme-arknights

明日方舟罗德岛阵营的 Hexo 主题,支持数学公式、Valine&Gitalk&Waline评论系统、Mermaid图表
https://arknights.theme.hexo.yue.zone/
MIT License
691 stars 74 forks source link

使用 hexo g 生成静态文件时无法生成 arknights.css #76

Closed Ling-Ink closed 2 years ago

Ling-Ink commented 2 years ago

RT,控制台输出如下

F:\#HexoBlog\blog>hexo clean && hexo g
INFO  Validating config
INFO  Deleted database.
INFO  Deleted public folder.
INFO  Validating config
INFO  Start processing
INFO  Files loaded in 3.55 s
ERROR {
  err: TypeError: F:/#HexoBlog/blog/themes/arknights/source/css/_core/aside.styl:75:14
     71|
     72| #aside-block
     73|   transition .3s
     74|   margin-top 10px
     75|   background linear-gradient(rgba(20, 21, 22, 0.8), #0000)
  --------------------^
     76|   #total-archives .total-number
     77|     letter-spacing 2px
     78|   @media ( min-width 769px )

  Cannot read properties of undefined (reading 'nodes')
      at "#aside-block" (F:/#HexoBlog/blog/themes/arknights/source/css/_core/aside.styl:73:1)

      at Evaluator.vendors (F:\#HexoBlog\blog\node_modules\stylus\lib\visitor\evaluator.js:1570:32)
      at Evaluator.unvendorize (F:\#HexoBlog\blog\node_modules\stylus\lib\visitor\evaluator.js:1584:30)
      at Evaluator.visitCall (F:\#HexoBlog\blog\node_modules\stylus\lib\visitor\evaluator.js:484:24)
      at Evaluator.Visitor.visit (F:\#HexoBlog\blog\node_modules\stylus\lib\visitor\index.js:28:40)
      at Evaluator.visit (F:\#HexoBlog\blog\node_modules\stylus\lib\visitor\evaluator.js:160:18)
      at Evaluator.visitExpression (F:\#HexoBlog\blog\node_modules\stylus\lib\visitor\evaluator.js:644:26)
      at Evaluator.Visitor.visit (F:\#HexoBlog\blog\node_modules\stylus\lib\visitor\index.js:28:40)
      at Evaluator.visit (F:\#HexoBlog\blog\node_modules\stylus\lib\visitor\evaluator.js:160:18)
      at Evaluator.visitProperty (F:\#HexoBlog\blog\node_modules\stylus\lib\visitor\evaluator.js:687:22)
      at Evaluator.Visitor.visit (F:\#HexoBlog\blog\node_modules\stylus\lib\visitor\index.js:28:40)
      at Evaluator.visit (F:\#HexoBlog\blog\node_modules\stylus\lib\visitor\evaluator.js:160:18)
      at Evaluator.visitBlock (F:\#HexoBlog\blog\node_modules\stylus\lib\visitor\evaluator.js:720:39)
      at Evaluator.Visitor.visit (F:\#HexoBlog\blog\node_modules\stylus\lib\visitor\index.js:28:40)
      at Evaluator.visit (F:\#HexoBlog\blog\node_modules\stylus\lib\visitor\evaluator.js:160:18)
      at Evaluator.visitGroup (F:\#HexoBlog\blog\node_modules\stylus\lib\visitor\evaluator.js:261:22)
      at Evaluator.Visitor.visit (F:\#HexoBlog\blog\node_modules\stylus\lib\visitor\index.js:28:40)
      at Evaluator.visit (F:\#HexoBlog\blog\node_modules\stylus\lib\visitor\evaluator.js:160:18)
      at Evaluator.visitBlock (F:\#HexoBlog\blog\node_modules\stylus\lib\visitor\evaluator.js:720:39)
      at Evaluator.Visitor.visit (F:\#HexoBlog\blog\node_modules\stylus\lib\visitor\index.js:28:40)
      at Evaluator.visit (F:\#HexoBlog\blog\node_modules\stylus\lib\visitor\evaluator.js:160:18)
      at Evaluator.importFile (F:\#HexoBlog\blog\node_modules\stylus\lib\visitor\evaluator.js:99:18)
      at Evaluator.visitImport (F:\#HexoBlog\blog\node_modules\stylus\lib\visitor\evaluator.js:920:27) {
    lineno: 75,
    column: 14,
    filename: 'F:/#HexoBlog/blog/themes/arknights/source/css/_core/aside.styl',
    stylusStack: '    at "#aside-block" (F:/#HexoBlog/blog/themes/arknights/source/css/_core/aside.styl:73:1)',
    input: 'aside\r\n' +
      '  &::-webkit-scrollbar\r\n' +
      '    display none\r\n' +
      '  &::-ms-scrollbar\r\n' +
      '    display none\r\n' +
      '  scrollbar-width none\r\n' +
      '  height 100vh\r\n' +
      '  position sticky\r\n' +
      '  display flex\r\n' +
      '  flex-direction column\r\n' +
      '  justify-content space-between\r\n' +
      '  align-content stretch\r\n' +
      '  overflow-y auto\r\n' +
      '  overflow-x hidden\r\n' +
      '  color #fff\r\n' +
      '  padding 0 20px\r\n' +
      '  h1\r\n' +
      '    font-family BenderLight, sans-serif\r\n' +
      '    margin-top 0\r\n' +
      '  footer\r\n' +
      '    color #898989\r\n' +
      '    padding 0 3px 30px 3px\r\n' +
      '    font-family BenderLight\r\n' +
      '\r\n' +
      '#logo\r\n' +
      '  user-select none\r\n' +
      '  width 100%\r\n' +
      '  height 5px\r\n' +
      '  display inline-block\r\n' +
      '  margin-bottom 100%\r\n' +
      '  padding 0\r\n' +
      '  img\r\n' +
      '    width 100%\r\n' +
      '\r\n' +
      '#Dr\r\n' +
      '  text-align center\r\n' +
      '  a\r\n' +
      '    color #fff\r\n' +
      '\r\n' +
      '#total\r\n' +
      '  margin 10px 0\r\n' +
      '  font-family BenderLight\r\n' +
      '  div\r\n' +
      '    display inline-block\r\n' +
      '\r\n' +
      '#total-archives\r\n' +
      '  color #fff\r\n' +
      '  box-sizing border-box\r\n' +
      '  width 100%\r\n' +
      '  border-left 5px solid #fff\r\n' +
      '  padding 0 0 0 10px\r\n' +
      '  display inline-block\r\n' +
      '  transition 1s\r\n' +
      '  .total-title\r\n' +
      '    font-size 23px\r\n' +
      '    display block\r\n' +
      '  .total-number\r\n' +
      '    font-weight bolder\r\n' +
      '    font-size 52px\r\n' +
      '    padding 0 10px\r\n' +
      '    transition .8s\r\n' +
      '  @media ( min-width 769px )\r\n' +
      '    &:hover\r\n' +
      '      border-color #2bf\r\n' +
      '      background-color rgba(#fff, .1)\r\n' +
      '      .total-number\r\n' +
      '        color #2bf\r\n' +
      '\r\n' +
      '#total-tags, #total-categories\r\n' +
      '  margin 15px 0 0 15px\r\n' +
      '\r\n' +
      '#aside-block\r\n' +
      '  transition .3s\r\n' +
      '  margin-top 10px\r\n' +
      '  background linear-gradient(rgba(20, 21, 22, 0.8), #0000)\r\n' +
      '  #total-archives .total-number\r\n' +
      '    letter-spacing 2px\r\n' +
      '  @media ( min-width 769px )\r\n' +
      '    &:hover h1\r\n' +
      '      background-color #2bf\r\n' +
      '  h1\r\n' +
      '    transition 1s\r\n' +
      '    color #000\r\n' +
      '    background-color #fff\r\n' +
      '    margin 0\r\n' +
      '    padding 0 10px\r\n' +
      '    font-size medium\r\n' +
      '\r\n' +
      '#description p\r\n' +
      '  margin unset\r\n' +
      '  text-align center\r\n'
  }
} Asset render failed: %s css/arknights.css
ERROR {
  err: SyntaxError: Unexpected token ] in JSON at position 40
      at JSON.parse (<anonymous>)
      at Hexo.jsonRenderer (F:\#HexoBlog\blog\node_modules\hexo\lib\plugins\renderer\json.js:4:15)
      at Hexo.tryCatcher (F:\#HexoBlog\blog\node_modules\bluebird\js\release\util.js:16:23)
      at Hexo.<anonymous> (F:\#HexoBlog\blog\node_modules\bluebird\js\release\method.js:15:34)
      at F:\#HexoBlog\blog\node_modules\hexo\lib\hexo\render.js:81:22
      at tryCatcher (F:\#HexoBlog\blog\node_modules\bluebird\js\release\util.js:16:23)
      at Promise._settlePromiseFromHandler (F:\#HexoBlog\blog\node_modules\bluebird\js\release\promise.js:547:31)
      at Promise._settlePromise (F:\#HexoBlog\blog\node_modules\bluebird\js\release\promise.js:604:18)
      at Promise._settlePromise0 (F:\#HexoBlog\blog\node_modules\bluebird\js\release\promise.js:649:10)
      at Promise._settlePromises (F:\#HexoBlog\blog\node_modules\bluebird\js\release\promise.js:729:18)
      at _drainQueueStep (F:\#HexoBlog\blog\node_modules\bluebird\js\release\async.js:93:12)
      at _drainQueue (F:\#HexoBlog\blog\node_modules\bluebird\js\release\async.js:86:9)
      at Async._drainQueues (F:\#HexoBlog\blog\node_modules\bluebird\js\release\async.js:102:5)
      at Immediate.Async.drainQueues [as _onImmediate] (F:\#HexoBlog\blog\node_modules\bluebird\js\release\async.js:15:14)
      at processImmediate (node:internal/timers:466:21)
} Asset render failed: %s js/tsconfig.json
INFO  Generated: search.json
INFO  Generated: archives/2022/05/index.html
INFO  Generated: archives/index.html
INFO  Generated: archives/2022/index.html
INFO  Generated: index.html
INFO  Generated: font/Geometos.ttf
INFO  Generated: cursor-inner.png
INFO  Generated: favicon.ico
INFO  Generated: css/arknights.css
INFO  Generated: font/JetBrainsMono-Regular.woff2
INFO  Generated: font/BenderLight.ttf
INFO  Generated: js/search.js
INFO  Generated: js/tsconfig.json
INFO  Generated: js/arknights.js
INFO  Generated: js/pjax.js
INFO  Generated: 404.html
INFO  Generated: 2022/05/20/hello-world/index.html
INFO  17 files generated in 640 ms
Yue-plus commented 2 years ago

是从旧版本升级上来的?之前从 sass 迁移到了 stylus 所以需要更换渲染器:

npm install hexo-renderer-stylus

之前的 sass 渲染器不需要的话可以移除


(另外当前版本有亿点点 bug,建议等 1.16

Ling-Ink commented 2 years ago

是第一次安装,按照README里的步骤做的

Yue-plus commented 2 years ago

应该是 bug Orz……


也许可以用着 dev 分支的版本,克隆主题时加上 -b dev

Ling-Ink commented 2 years ago

换成 dev 分支之后又换了个地方报错...

ERROR {
  err: TypeError: F:/#HexoBlog/blog/themes/arknights/source/css/_core/base.styl:5:33
     1| // ========= 基础样式
     2| // ====== base style
     3| html, body
     4|   height 100%
     5|   cursor url(../cursor-inner.png) 3 3, default
  --------------------------------------^
     6|   position static
     7|
     8| a, button

  Cannot read properties of undefined (reading 'nodes')
      at "html" (F:/#HexoBlog/blog/themes/arknights/source/css/_core/base.styl:3:1)

看来我应该试试1.15 并没有用Orz...我怀疑是电脑问题,但另一台也是这样

Ling-Ink commented 2 years ago

发现是我装的 hexo-renderer-stylus 模块中自带的stylus版本较低导致的问题