mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2026-04-16 20:30:53 +08:00
Merge branch 'dev' into master
This commit is contained in:
@@ -11,5 +11,6 @@ const urlFor = require('hexo-util').url_for.bind(hexo)
|
|||||||
hexo.extend.filter.register('after_post_render', data => {
|
hexo.extend.filter.register('after_post_render', data => {
|
||||||
if (!hexo.theme.config.lazyload.enable) return
|
if (!hexo.theme.config.lazyload.enable) return
|
||||||
const bg = hexo.theme.config.lazyload.post ? urlFor(hexo.theme.config.lazyload.post) : 'data:image/gif;base64,R0lGODdhAQABAPAAAMPDwwAAACwAAAAAAQABAAACAkQBADs='
|
const bg = hexo.theme.config.lazyload.post ? urlFor(hexo.theme.config.lazyload.post) : 'data:image/gif;base64,R0lGODdhAQABAPAAAMPDwwAAACwAAAAAAQABAAACAkQBADs='
|
||||||
return data.content.replace(/(<img.*? src=)/ig, `$1 "${bg}" data-lazy-src=`)
|
data.content = data.content.replace(/(<img.*? src=)/ig, `$1 "${bg}" data-lazy-src=`)
|
||||||
|
return data
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user