Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fixes the following error in the `cms-kontent` example by implementing an `Image` component to wrap `Next/Image` with a custom loader. ``` Invalid src prop ... hostname "assets-eu-01.kc-usercontent.com" is not configured under images in your `next.config.js` ``` * This error is affecting both the `pages/index.js` and `pages/posts/[slug].js` routes. * Uses a custom loader rather than adding the Kontent asset domains to `next.config.js` as we can transform the images using the Kontent Delivery API directly rather than delegating this to the Next app web server. Ref: * https://nextjs.org/docs/messages/next-image-unconfigured-host * https://nextjs.org/docs/basic-features/image-optimization * https://meeg.dev/blog/using-the-next-image-component-with-kentico-kontent-assets * https://github.com/Kentico/kontent-starter-corporate-next-js/blob/b7c9ef588c2e316557095e3160e712a1220601f5/components/Image.js * https://kontent.ai/learn/reference/image-transformation/
- Loading branch information