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/',
|
||||
defaultAttributes: {
|
||||
loading: 'lazy',
|
||||
decoding: 'async'
|
||||
decoding: 'async',
|
||||
sizes: '(min-width: 1280px) 960px, (min-width: 1024px) 768px, (min-width: 640px) 640px, 480px'
|
||||
}
|
||||
});
|
||||
eleventyConfig.addPlugin(feedPlugin, {
|
||||
|
|
|
@ -20,7 +20,7 @@ pagination:
|
|||
</div>
|
||||
|
||||
{% 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 %}
|
||||
|
||||
<p>{{ post.data.description }}</p>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue