Hivekind / hivekind.com

0 stars 0 forks source link

use contentful image optimization #92

Closed parasquid closed 2 months ago

parasquid commented 3 months ago

there is a way to use contentful images api for image optimization (and convert remote images to webp for example)

https://www.contentful.com/developers/docs/references/images-api/

all images loaded remotely (work, blog, about) should use the contentful images api

parasquid commented 3 months ago

see https://www.contentful.com/developers/docs/references/images-api/#/reference/changing-formats/image-format/retrieve-an-image/console/curl for the format

curl --include \
     --request GET \
     https://images.ctfassets.net/{space_id}/{asset_id}/{unique_id}/{name}?fm={image_format}
shuwnyuantee commented 2 months ago

Next.js doc for implementing Custom Image Loader for Contentful image: https://nextjs.org/docs/app/api-reference/next-config-js/images#contentful