Skip to content

Releases: delicious-simplicity/next-image-contentful-loader

@delicious-simplicity/next-image-contentful-loader@v1.0.4

What's Changed

  • fix h=undefined in parsed url by @devjmetivier in #1
  • fixes quality property being properly set in all scenarios
  • add tests around url generation

Full Changelog: https://github.com/delicious-simplicity/next-image-contentful-loader/commits/@delicious-simplicity/next-image-contentful-loader@v1.0.4

v1.0.2

Fixes a bug where it was possible that h=undefined would make it into the url made from the URLSearchParams constructor. Condition was added to check the type of the h so it could be deleted if it was undefined.

v1

v1

Features

  • Allows for native Contentful image params/options
  • Similar error boundaries as next/image
  • Additional options for managing the aspect ratio of requested images

Usage

import Image from "next/image";
import { contentfulLoader } from "@delicious-simplicity/next-image-contentful-loader";

const Component = ({ image }) => {
  return (
    <>
      <Image
        loader={(props) => contentfulLoader(props, { fit: "crop", ar: "1:1" })}
        src={image.url}
        alt={image.title}
        width={image.width}
        height={image.height}
      />
    </>
  );
};