This commit is contained in:
xaoxuu 2021-03-05 00:07:45 +08:00
parent 07fa734341
commit d6075f27bd
4 changed files with 12 additions and 8 deletions

View File

@ -102,9 +102,6 @@ tag_plugins:
# {% checkbox %}
checkbox:
interactive: false # enable interactive for user
# {% link url title [img:src] [description] %}
link:
default_img: https://7.dusays.com/2021/02/20/8f277b4ee0ecd.svg
######## JS Plugins ########

View File

@ -24,7 +24,12 @@ hexo.extend.tag.register('link', function(args) {
// right
el += '<div class="right">';
el += '<img src="' + (args.img || hexo.theme.config.tag_plugins.link.default_img) + '"/>';
if (hexo.theme.config.plugins.lazyload && hexo.theme.config.plugins.lazyload.enable) {
el += '<div class="lazy img" data-bg="' + (args.img || hexo.theme.config.default.link) + '"></div>';
} else {
el += '<div class="lazy img" style="background-image:url(&quot;' + (args.img || hexo.theme.config.default.link) + '&quot;)"></div>';
}
el += '</div>';
// end

View File

@ -135,3 +135,9 @@ a[onclick]:hover
input
background: none
border: none
div.lazy.img
width: 100%
height: 100%
background-position: center
background-size: cover

View File

@ -29,10 +29,6 @@
margin: 0.75rem
overflow: hidden
flex-shrink: 0
img
width: 100%
height: 100%
object-fit: cover
div.left
overflow: hidden
margin-left: 16px