HeskeyBaozi / hexo-theme-lite

Keep Calm, Light and Writing. Light Hexo Theme.
https://heskeybaozi.github.io
MIT License
165 stars 37 forks source link

hexo new test problem #45

Closed oneofsunshine closed 6 years ago

oneofsunshine commented 6 years ago

环境:

mac os x 10.11.6 npm: 5.6.0 node: 8.11.1 package.json:

{
  "name": "hexo-site",
  "version": "0.0.0",
  "private": true,
  "hexo": {
    "version": "3.7.1"
  },
  "dependencies": {
    "hexo": "^3.2.0",
    "hexo-generator-archive": "^0.1.4",
    "hexo-generator-category": "^0.1.3",
    "hexo-generator-index": "^0.2.0",
    "hexo-generator-tag": "^0.2.0",
    "hexo-renderer-ejs": "^0.3.0",
    "hexo-renderer-stylus": "^0.3.1",
    "hexo-renderer-marked": "^0.3.0",
    "hexo-server": "^0.2.0"
  }
}

当我使用这个主题后hexo new test之后hexo g会报一下错误:

TypeError: Cannot read property 'substring' of null
    at postMap (/Users/vision/loveder/myblg/themes/lite/scripts/generate-api.js:86:63)
    at Model._Query.Query.Query.map (/Users/vision/loveder/myblg/node_modules/warehouse/lib/query.js:229:17)
    at generator (/Users/vision/loveder/myblg/themes/lite/scripts/generate-api.js:194:26)
    at Hexo.<anonymous> (/Users/vision/loveder/myblg/themes/lite/scripts/generate-api.js:300:10)
    at Hexo.tryCatcher (/Users/vision/loveder/myblg/node_modules/bluebird/js/release/util.js:16:23)
    at Hexo.<anonymous> (/Users/vision/loveder/myblg/node_modules/bluebird/js/release/method.js:15:34)
    at Promise.map.key (/Users/vision/loveder/myblg/node_modules/hexo/lib/hexo/index.js:336:26)
    at tryCatcher (/Users/vision/loveder/myblg/node_modules/bluebird/js/release/util.js:16:23)
    at MappingPromiseArray._promiseFulfilled (/Users/vision/loveder/myblg/node_modules/bluebird/js/release/map.js:61:38)
    at MappingPromiseArray.PromiseArray._iterate (/Users/vision/loveder/myblg/node_modules/bluebird/js/release/promise_array.js:114:31)
    at MappingPromiseArray.init (/Users/vision/loveder/myblg/node_modules/bluebird/js/release/promise_array.js:78:10)
    at MappingPromiseArray._asyncInit (/Users/vision/loveder/myblg/node_modules/bluebird/js/release/map.js:30:10)
    at Async._drainQueue (/Users/vision/loveder/myblg/node_modules/bluebird/js/release/async.js:138:12)
    at Async._drainQueues (/Users/vision/loveder/myblg/node_modules/bluebird/js/release/async.js:143:10)
    at Immediate.Async.drainQueues (/Users/vision/loveder/myblg/node_modules/bluebird/js/release/async.js:17:14)
    at runCallback (timers.js:794:20)
    at tryOnImmediate (timers.js:752:5)
    at processImmediate [as _immediateCallback] (timers.js:729:5)

请问这是什么原因&请问怎么解决?

感觉这个主题很梦幻,很喜欢,感谢大佬开源~

HeskeyBaozi commented 6 years ago

确保所有文章内容不为空。

也就是说你hexo new test后,要在这个文章里至少随便打一点东西。

内容不为空是指文章内容(开头三横杠以下的的内容)不能为空。

oneofsunshine commented 6 years ago

好的,非常感谢~

FaustYKKN commented 5 years ago

Hi ~ 要是把 scripts\generate-api.js:16:44 的 function filterHTMLTags 返回值由 null 改为 String() ,可以直接写空博客,但是会不会出 bug 呢? 很棒的主题呦,大赞~