From f7d57ac8839094864df7a6a564d1143d07c72d5f Mon Sep 17 00:00:00 2001 From: Jerry <16351105+jerryc127@users.noreply.github.com> Date: Fri, 17 Jul 2020 00:51:18 +0800 Subject: [PATCH] fix lazyload --- layout/includes/third-party/pjax.pug | 4 +++- scripts/filters/post_lazyload.js | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/layout/includes/third-party/pjax.pug b/layout/includes/third-party/pjax.pug index 42b4fb9..831eab9 100644 --- a/layout/includes/third-party/pjax.pug +++ b/layout/includes/third-party/pjax.pug @@ -36,7 +36,9 @@ script. document.addEventListener('pjax:send', function () { if (window.aplayers) { for (let i = 0; i < window.aplayers.length; i++) { - if (!window.aplayers[i].options.fixed) window.aplayers[i].destroy() + if (!window.aplayers[i].options.fixed) { + window.aplayers[i].destroy() + } } } diff --git a/scripts/filters/post_lazyload.js b/scripts/filters/post_lazyload.js index f41b97b..92857cc 100644 --- a/scripts/filters/post_lazyload.js +++ b/scripts/filters/post_lazyload.js @@ -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(/(