Source plugin for pulling data into GatsbyJS from Directus CMS (https://directus.io)
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.
To install the @directus/gatsby-source-directus plugin, follow these steps:
npm install -g gatsby-cli
npm install @directus/gatsby-source-directus --save
gatsby-config.js file:module.exports = {
plugins: [
{
resolve: "@directus/gatsby-source-directus",
options: {
// Configuration options here
},
},
],
}
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.