image icon indicating copy to clipboard operation
image copied to clipboard

static placeholder and seo

Open djixadin opened this issue 1 year ago • 1 comments

this is more of a question and less so an issue.. when specifying static placeholder image from public folder as a placeholder the html that is generated has that image as a src for the image as the onMounted fires it changes the image source to a proper one.. its my understanding that this affects SEO poorly and is there some workaround for this ?

djixadin avatar Nov 17 '23 11:11 djixadin

you can do your own "placeholder" image:

<NuxtImg
src="your-source.jpg"
style="`background-image:url(${ $img(src: 'your-source.jpg', {w: 10, q: 70}) }`; background-repeat: no-repeat; background-size: cover" />

..and then use useHead() to add that generated background image to preload.

bernhardberger avatar Dec 10 '23 23:12 bernhardberger