diff --git a/templates/album.html b/templates/album.html index 18dde1ca..84371b59 100644 --- a/templates/album.html +++ b/templates/album.html @@ -24,7 +24,6 @@ @@ -45,10 +44,8 @@ [[${group.spec.displayName}]] diff --git a/templates/assets/js/main.js b/templates/assets/js/main.js index 134e21cb..5f5e4599 100644 --- a/templates/assets/js/main.js +++ b/templates/assets/js/main.js @@ -443,7 +443,10 @@ document.addEventListener('DOMContentLoaded', function () { window.lazyLoadInstance = new LazyLoad({ elements_selector: 'img', threshold: 0, - data_src: 'lazy-src' + data_src: 'lazy-src', + callback_error: (img) => { + img.setAttribute("srcset", GLOBAL_CONFIG.lazyload.error); + } }) } diff --git a/templates/equipment.html b/templates/equipment.html index 2a1048a4..5e3b0ddc 100644 --- a/templates/equipment.html +++ b/templates/equipment.html @@ -28,9 +28,10 @@ - + th:src="${isLazyload ? loadingImg : equipment.img}" + th:data-lazy-src="${ isLazyload ? equipment.img : ''}"> diff --git a/templates/macro/content-links.html b/templates/macro/content-links.html index d7271aa8..c3871f6d 100644 --- a/templates/macro/content-links.html +++ b/templates/macro/content-links.html @@ -27,7 +27,6 @@ @@ -96,7 +94,7 @@ @@ -105,7 +103,7 @@ th:title="${link.spec.displayName}"> @@ -129,14 +127,14 @@ - @@ -150,7 +148,7 @@ diff --git a/templates/modules/head.html b/templates/modules/head.html index 9f19d7b6..8c1cdb9b 100644 --- a/templates/modules/head.html +++ b/templates/modules/head.html @@ -195,7 +195,7 @@ postUpdate: '2022-11-04 20:08:15', copyright: undefined, lightbox: 'fancybox', - lazyload: {enable: [[${theme.config.other.vanillaLazyload.enable}]], error: "/themes/theme-hao/assets/images/404.gif"}, + lazyload: {enable: [[${theme.config.other.vanillaLazyload.enable}]], error: [[@{${theme.config.other.vanillaLazyload.errorImg}}]] }, isFriendLinksInFooter: [[${theme.config.footer.footer_group.enable_footer_group}]], loadingBox: [[${theme.config.other.loadingBoxs.loadingBoxEnable}]], loadProgressBar: [[${theme.config.other.loadingBoxs.loadProgressBar}]], diff --git a/templates/modules/layouts/layout.html b/templates/modules/layouts/layout.html index c90099a2..8f122af9 100644 --- a/templates/modules/layouts/layout.html +++ b/templates/modules/layouts/layout.html @@ -4,7 +4,6 @@ theme.config.other.staticResource.use == 'cbd' ? 'https://cdn.cbd.int/hao-theme-static@' + theme.spec.version +'/templates/assets' : theme.config.other.staticResource.use == 'custom' ? theme.config.other.staticResource.cdn_link : #theme.assets('/')}, theme_version = ${ theme.config.other.staticResource.use == 'local' ? '?v='+ theme.spec.version : ''}, - errorImg = @{${theme.config.other.vanillaLazyload.errorImg}}, isLazyload = ${theme.config.other.vanillaLazyload.enable}, loadingImg = ${theme.config.other.vanillaLazyload.loadingImg}"> diff --git a/templates/modules/post-list.html b/templates/modules/post-list.html index 405f2c57..e5ae9910 100644 --- a/templates/modules/post-list.html +++ b/templates/modules/post-list.html @@ -18,7 +18,6 @@ diff --git a/templates/modules/post/relatedPosts.html b/templates/modules/post/relatedPosts.html index e36d770b..0ec8da1e 100644 --- a/templates/modules/post/relatedPosts.html +++ b/templates/modules/post/relatedPosts.html @@ -18,7 +18,6 @@ containsTitle = ${#strings.contains(recommandPosts,post.spec.title)}"> @@ -39,7 +38,7 @@ containsTitle = ${#strings.contains(recommandPosts,post.spec.title)}"> diff --git a/templates/modules/widgets/about-widgets/game.html b/templates/modules/widgets/about-widgets/game.html index 3cc0872d..b3f5c485 100644 --- a/templates/modules/widgets/about-widgets/game.html +++ b/templates/modules/widgets/about-widgets/game.html @@ -40,7 +40,7 @@ rel="external nofollow noreferrer" target="_blank" th:title="${comic.title}" draggable="false"> @@ -36,7 +36,7 @@ diff --git a/templates/modules/widgets/aside/profile.html b/templates/modules/widgets/aside/profile.html index 46cc409a..1d07734d 100644 --- a/templates/modules/widgets/aside/profile.html +++ b/templates/modules/widgets/aside/profile.html @@ -14,7 +14,7 @@ @@ -146,13 +146,13 @@ diff --git a/templates/modules/widgets/aside/recent-posts.html b/templates/modules/widgets/aside/recent-posts.html index 24c86d59..efe2d20f 100644 --- a/templates/modules/widgets/aside/recent-posts.html +++ b/templates/modules/widgets/aside/recent-posts.html @@ -9,7 +9,7 @@ diff --git a/templates/modules/widgets/banner-group.html b/templates/modules/widgets/banner-group.html index 33e118e2..4fc3d266 100644 --- a/templates/modules/widgets/banner-group.html +++ b/templates/modules/widgets/banner-group.html @@ -21,7 +21,7 @@ @@ -29,7 +29,7 @@ @@ -39,7 +39,7 @@ @@ -47,7 +47,7 @@ @@ -57,7 +57,7 @@ @@ -65,7 +65,7 @@ @@ -75,7 +75,7 @@ @@ -83,7 +83,7 @@ @@ -93,7 +93,7 @@ @@ -101,7 +101,7 @@ @@ -111,7 +111,7 @@ @@ -119,7 +119,7 @@ @@ -129,7 +129,7 @@ @@ -137,7 +137,7 @@ @@ -147,7 +147,7 @@ @@ -155,7 +155,7 @@ @@ -165,7 +165,7 @@ @@ -173,7 +173,7 @@ @@ -183,7 +183,7 @@ @@ -191,7 +191,7 @@ @@ -201,7 +201,7 @@ @@ -209,7 +209,7 @@ @@ -219,7 +219,7 @@ @@ -227,7 +227,7 @@ @@ -237,7 +237,7 @@ @@ -245,7 +245,7 @@ @@ -255,7 +255,7 @@ @@ -263,7 +263,7 @@ @@ -282,7 +282,7 @@ th:with="techOdd = ${techs.get(iterStat.index - 1)}"> @@ -293,7 +293,7 @@ th:with="techEven = ${tech}"> diff --git a/templates/modules/widgets/top-group.html b/templates/modules/widgets/top-group.html index 1b7c760f..e452961b 100644 --- a/templates/modules/widgets/top-group.html +++ b/templates/modules/widgets/top-group.html @@ -16,7 +16,7 @@ diff --git a/templates/post.html b/templates/post.html index f5ce8c5e..168efc61 100644 --- a/templates/post.html +++ b/templates/post.html @@ -126,7 +126,7 @@ 上一篇 @@ -139,7 +139,6 @@ 下一篇