Merge branch 'dev' into master

This commit is contained in:
Jerry
2020-08-02 23:31:32 +08:00
Unverified

View File

@@ -11,5 +11,6 @@ const urlFor = require('hexo-util').url_for.bind(hexo)
hexo.extend.filter.register('after_post_render', data => {
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='
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
})