diff --git a/settings.yaml b/settings.yaml index abbfc9cd..0e75c752 100644 --- a/settings.yaml +++ b/settings.yaml @@ -2661,6 +2661,25 @@ spec: validation: required value: 'https://npm.onmicrosoft.cn/hao-theme-static@1.3.0/templates/assets' help: '默认为npmJs的onmicrosoft加速地址,如果你有自己的cdn地址(请确保链接下assets文件夹下主题静态资源文件),可以填写,否则请勿修改! ' + - $formkit: group + name: vanillaLazyload + label: 懒加载 + value: + enable: true + errorImg: "/themes/theme-hao/assets/images/404.gif" + children: + - $formkit: radio + name: enable + options: + - label: 启用 + value: true + - label: 禁用 + value: false + - $formkit: attachment + name: errorImg + label: 图片加载失败图 + validation: required + placeholder: 请输入图片 url - $formkit: group name: diytitle label: 动态标题 diff --git a/templates/album.html b/templates/album.html index 2c8e9af3..2f333b39 100644 --- a/templates/album.html +++ b/templates/album.html @@ -24,9 +24,10 @@
+ th:src="${isLazyload ? dataImage : #annotations.get(group, 'cover')}" + th:data-lazy-src="${ isLazyload ? #annotations.get(group, 'cover') : ''}" + >

@@ -44,9 +45,11 @@
@@ -87,18 +95,19 @@ + th:src="${isLazyload ? dataImage : img}" + th:data-lazy-src="${ isLazyload ? img : ''}">
+ th:src="${isLazyload ? dataImage : link.spec.logo}" + th:data-lazy-src="${ isLazyload ? link.spec.logo : ''}">
@@ -141,9 +150,9 @@
[[${link.spec.displayName}]]