mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2026-06-05 21:01:46 +08:00
fix lazyload
This commit is contained in:
@@ -10,7 +10,7 @@ const urlFor = require('hexo-util').url_for.bind(hexo)
|
||||
|
||||
function lazyProcess (htmlContent) {
|
||||
const bg = hexo.theme.config.lazyload.post ? urlFor(hexo.theme.config.lazyload.post) : 'data:image/gif;base64,R0lGODdhAQABAPAAAMPDwwAAACwAAAAAAQABAAACAkQBADs='
|
||||
return htmlContent.replace(/(<img .*? src=)/ig, `$1 "${bg}" data-lazy-src=`)
|
||||
return htmlContent.replace(/(<img.*? src=)/ig, `$1 "${bg}" data-lazy-src=`)
|
||||
}
|
||||
|
||||
const processPost = function (data) {
|
||||
|
||||
Reference in New Issue
Block a user