Bukwild Contentful Utils screenshot

Bukwild Contentful Utils

Author Avatar Theme by Bkwld
Updated: 8 Dec 2020
5 Stars

Utilities for interacting with Contentful, designed with Vue and Nuxt in mind.

Categories

Overview:

The bukwild-contentful-utils is a set of utilities designed to interact with Contentful, with a specific focus on using Vue and Nuxt. It provides functions and methods that can be used to configure and access Contentful API data within Vue and Nuxt components.

Features:

  • ImgHelper: A method for creating Contentful URLs that transform images. It allows you to specify the image width, height, format, quality, and resizing behavior.
  • Aspect: A method for returning the aspect ratio of an image. It takes an image field from a Contentful entry result and returns the aspect ratio.
  • Queries: Helper methods for querying Contentful. These methods include getEntry, getEntryBySlug, getEntries, and getPaginatedEntries, which allow you to retrieve single entries, entries by slug, lists of entries, and paginated lists of entries for a given content type.
  • References: Helpers for dealing with references in Contentful. These methods include refs and ref, which filter out broken references and merge in the id, dates, and sys attributes.
  • SEO: A helper for setting SEO-related fields in Nuxt’s head property. It assumes that you have created a Contentful content model for SEO fields, with fields for title, description, image, and robots.

Installation:

To install the bukwild-contentful-utils package, you can use either Yarn or npm.

Using Yarn:

yarn add bukwild-contentful-utils

Using npm:

npm install --save bukwild-contentful-utils

Summary:

The bukwild-contentful-utils package provides a set of utilities for interacting with the Contentful API, specifically aimed at integrating with Vue and Nuxt. It offers functions for working with images, querying data from Contentful, handling references, and setting SEO-related fields. These utilities can be easily installed and configured within your Vue or Nuxt project.