Gatsby Source Directus7 screenshot

Gatsby Source Directus7

Author Avatar Theme by Jonesus
Updated: 22 Nov 2022
16 Stars

Source plugin for pulling data into GatsbyJS from Directus CMS (https://directus.io)

Categories

Overview:

The @directus/gatsby-source-directus plugin is a source plugin for pulling data into Gatsby from Directus CMS. It creates Gatsby nodes for all Directus collections and establishes relationships between them for easy GraphQL querying. The plugin also downloads all files from Directus’s uploads and links them to their respective items for easy usability. This plugin is particularly useful for creating dynamic content, such as blog posts, from Directus in a Gatsby site.

Features:

  • Creates Gatsby nodes for all Directus collections
  • Establishes relationships between collection items for easy GraphQL querying
  • Downloads and links files from Directus’s uploads for easy usability
  • Works well with Gatsby’s createPages function for dynamically creating content

Installation:

To install the @directus/gatsby-source-directus plugin, follow these steps:

  1. Install Gatsby:
npm install -g gatsby-cli
  1. Install the plugin:
npm install @directus/gatsby-source-directus --save
  1. Configure the plugin in the gatsby-config.js file:
module.exports = {
  plugins: [
    {
      resolve: "@directus/gatsby-source-directus",
      options: {
        // Configuration options here
      },
    },
  ],
}

Summary:

The @directus/gatsby-source-directus plugin is a powerful tool for pulling data from Directus CMS into Gatsby. It creates Gatsby nodes for each Directus collection and establishes relationships between them for easy querying. The plugin also downloads and links files from Directus’s uploads for simple usability. This plugin is a great option for creating dynamic content, such as blog posts, in a Gatsby website.