Lazy load media
This commit is contained in:
parent
c09f576cc1
commit
848ccf0ff3
3 changed files with 5 additions and 1 deletions
|
|
@ -16,8 +16,11 @@ export const generate = ({
|
|||
}): html => `
|
||||
${container ? `<div class="figure-container">` : ''}
|
||||
<img tabindex="0"
|
||||
loading="lazy"
|
||||
srcset="${image.srcSet}"
|
||||
sizes="${sizes}"
|
||||
width="${image.width}"
|
||||
height="${image.height}"
|
||||
src="${last(image.images)?.path}"
|
||||
alt="${alt}"
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ export const generate = ({
|
|||
container: boolean;
|
||||
}): html => `
|
||||
${container ? `<div class="figure-container">` : ''}
|
||||
<video ${options} ${poster ? `poster="${poster}` : ''}" >
|
||||
<video loading="lazy" ${options} ${poster ? `poster="${poster}` : ''}" >
|
||||
<source src="${webm}" type="video/webm"/>
|
||||
<source src="${mp4}" type="video/mp4"/>
|
||||
</video>
|
||||
|
|
|
|||
|
|
@ -63,6 +63,7 @@ html {
|
|||
position: relative;
|
||||
z-index: -2;
|
||||
width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue