Hexo-theme-next: 5.0.1版本next lazyload失效了?

Created on 20 Jul 2016  ·  11Comments  ·  Source: iissnan/hexo-theme-next

对比

我的博客,首页加载完毕大概2-3M:www.iamlj.com

以前版本的某位博主的,首页加载完毕大概500K~1M:www.arao.me

现在next主题普遍都有这个问题,文章预览图片功能很赞。
不过图片导致首页加载慢,加之国内墙的原因,博客加载就更慢了。

Docs Optimization

Most helpful comment

插件没问题,只是本身lazyLoad这插件有使用条件,它引用路径方式要写成data-original而不是src,而在markdown里面使用![]()方式插入图片,5.0.1的模版并没对src做修改,要生效,在markdown插入图片是直接写src的代码:<img data-original="图片地址" />即可,我的网站没问题:http://codeliker.com/

All 11 comments

图片可以考虑国内cdn平台。

我用的是七牛,不过这2M的加载,的确拉低了很多速度。
所以才想的整lazyload,但是主题内置的功能是失效的,我尝试自己添加,也还是失效...

插件没问题,只是本身lazyLoad这插件有使用条件,它引用路径方式要写成data-original而不是src,而在markdown里面使用![]()方式插入图片,5.0.1的模版并没对src做修改,要生效,在markdown插入图片是直接写src的代码:<img data-original="图片地址" />即可,我的网站没问题:http://codeliker.com/

另外,我现在用的不是lazyLoad,那个要10k太大了,建议换Echo.js,这个更小。

@skybluefly 亲测有效,感谢!

不过首页小图预览这个需求依然 + 1...

@Maples7 这个主题原本有这个功能的?如果不是,通常做法是:开头插入一张图片,然后在markdown一定的范围<!-- more -->就行了

@skybluefly 我主要的需求是对 grouppictures 样式,在主页用缩略图。

@Maples7 不懂,有示例么?

@shliujing dont understand u, write in English if not solved. If solved, close it please. Thank's!

1649 (PART 4. Lazy load images.).

Was this page helpful?
0 / 5 - 0 ratings

Related issues

zhgcao picture zhgcao  ·  3Comments

DVD0423 picture DVD0423  ·  3Comments

ifgao picture ifgao  ·  4Comments

bingstyle picture bingstyle  ·  3Comments

LionWY picture LionWY  ·  3Comments