add img loading lazy tag

This commit is contained in:
Nofated095 2024-01-12 10:03:11 +08:00
parent c94b4380d3
commit de787c7f26
3 changed files with 4 additions and 4 deletions

View File

@ -37,9 +37,9 @@ module.exports = class extends Component {
{/* Thumbnail */}
{cover ? <div class="card-image">
{index ? <a href={url_for(page.link || page.path)} class="image is-7by3">
<img class="fill" src={cover} alt={page.title || cover} />
<img class="fill" src={cover} alt={page.title || cover} loading="lazy" />
</a> : <span class="image is-7by3">
<img class="fill" src={cover} alt={page.title || cover} />
<img class="fill" src={cover} alt={page.title || cover} loading="lazy" />
</span>}
</div> : null}
<article class={`card-content article${'direction' in page ? ' ' + page.direction : ''}`} role="article">

View File

@ -35,7 +35,7 @@ class Profile extends Component {
<div class="level-item has-text-centered flex-shrink-1">
<div>
<figure class="image is-128x128 mx-auto mb-2">
<img class={'avatar' + (avatarRounded ? ' is-rounded' : '')} src={avatar} alt={author} />
<img class={'avatar' + (avatarRounded ? ' is-rounded' : '')} src={avatar} alt={author} loading="lazy" />
</figure>
{author ? <p class="title is-size-4 is-block" style={{'line-height': 'inherit'}}>{author}</p> : null}
{authorTitle ? <p class="is-size-6 is-block">{authorTitle}</p> : null}

View File

@ -1,6 +1,6 @@
{
"name": "hexo-theme-amane",
"version": "0.0.42",
"version": "0.0.43",
"author": "Nofated095 <nofated095@users.noreply.github.com>",
"license": "MIT",
"description": "A simple, delicate, and modern theme for Hexo",