shenliyang / hexo-theme-snippet

Snippet 简洁而不简单,也许是一款你寻找已久的hexo主题
https://snippet.shenliyang.com/
MIT License
1.09k stars 208 forks source link

hexo g 报错 #128

Closed smartlin closed 5 years ago

smartlin commented 5 years ago

请问这是什么错误啊,但是部署还是能够成功的,但是我的某一页无法显示,如http://example.com/page/4/ Unhandled rejection TypeError: E:\Hexo\themes\hexo-theme-snippet\layout\index.ejs:11 9| <% if(page.posts && page.posts.length){ %> 10| <% page.posts.forEach(function (post, i) { %>

11| <% 12| var urls = lazyImage(post); 13| var random = Math.floor(Math.random() * (urls.length)); 14| if(theme.defaultImgs && theme.defaultImgs.length >0){

Cannot read property '0' of null at E:\Hexo\themes\hexo-theme-snippet\scripts\helper.js:8:35 at Array.forEach () at Object.lazyImage (E:\Hexo\themes\hexo-theme-snippet\scripts\helper.js:7:28) at Object.wrapper [as lazyImage] (E:\Hexo\node_modules\hexo\node_modules\lodash\lodash.js:4949:19) at eval (eval at compile (E:\Hexo\node_modules\ejs\lib\ejs.js:549:12), :28:16) at Model._Query.Query.Query.forEach (E:\Hexo\node_m

shenliyang commented 5 years ago

请检查第三页以后每篇文章的 Front-matter部分:

img: "",  // img字段只能是唯一字符串或者为空,不能为数组或其他格式,因为缩略图只能有一个

如果排查后问题依然存在,建议发送非保密的文章md文件到邮箱:snippet@91h5.cc

smartlin commented 5 years ago

已解决了,图片路径有点问题,感谢