feat: 💄 apply sizes attribute to image elements globally
This commit is contained in:
parent
796619d22b
commit
9dbd68c048
2 changed files with 3 additions and 2 deletions
|
@ -76,7 +76,8 @@ export default async function (eleventyConfig) {
|
||||||
outputDir: './public/img/',
|
outputDir: './public/img/',
|
||||||
defaultAttributes: {
|
defaultAttributes: {
|
||||||
loading: 'lazy',
|
loading: 'lazy',
|
||||||
decoding: 'async'
|
decoding: 'async',
|
||||||
|
sizes: '(min-width: 1280px) 960px, (min-width: 1024px) 768px, (min-width: 640px) 640px, 480px'
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
eleventyConfig.addPlugin(feedPlugin, {
|
eleventyConfig.addPlugin(feedPlugin, {
|
||||||
|
|
|
@ -20,7 +20,7 @@ pagination:
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% if post.data.image and post.data.image.src != '' %}
|
{% if post.data.image and post.data.image.src != '' %}
|
||||||
<img src="{{ post.data.image.src }}" alt="{{ post.data.image.alt }}" sizes="(min-width: 1280px) 960px, (min-width: 1024px) 768px, (min-width: 640px) 640px, 480px">
|
<img src="{{ post.data.image.src }}" alt="{{ post.data.image.alt }}">
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<p>{{ post.data.description }}</p>
|
<p>{{ post.data.description }}</p>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue