0.10.5 • Published 5 years ago
gatsby-source-netlify-cms v0.10.5
gastby-source-netlify-cms (Beta)
setting up your gatsby-config.js
Default setup uses the helper functions imported from the plugin.
const config = require(`config.json`); // netlify-cms config file (json format required)
const { createPluginPaths, createPluginOptions } = require('gatsby-source-netlify-cms');
module.exports = {
plugins: [
{
resolve: "gatsby-source-netlify-cms",
options: createPluginOptions(config)
},
...createPluginPaths(config),
]
}
Note: The options.types
of this plugin must match the options.name
targets of the plugin paths being setup for the gatsby-source-filesystem
plugin. If you plan to set these up manually, make sure to adhere to this naming convention or this plugin will ignore the nodes during onCreateNode
.
Information
This configuration and plugin is going to do the following:
- Create a valid options object for the source plugin using helper
createPluginOptions
- Sets up the
gatsby-source-filesystem
plugins to the paths of collections using helpercreatePluginPaths
- Plugin will resolve the paths for the cms using the config during
onPreBootstrap
. If they don't exist, the plugin will create them. - Plugin creates the schema from the config using Gatsby's
actions.createTypes
duringcreateSchemaCustomization
and using theoptions.types
created bycreatePluginOptions
- Plugin creates the nodes during
onCreateNode
using the nodes created bygatsby-source-filesystem
setup bycreatePluginPaths
and the types configuration created bycreatePluginOptions
- All the options and plugins can be configured manually if a more advanced naming of nodes and types is needed.
0.10.5
5 years ago
0.10.4
5 years ago
0.10.3
5 years ago
0.10.0
5 years ago
0.9.6
5 years ago
0.9.5
5 years ago
0.9.4
5 years ago
0.9.3
5 years ago
0.9.2
5 years ago
0.9.1
5 years ago
0.9.0
5 years ago
0.8.2
5 years ago
0.8.1
5 years ago
0.8.0
5 years ago
0.7.4
5 years ago
0.7.3
5 years ago
0.7.2
5 years ago
0.7.1
5 years ago
0.7.0
5 years ago
0.5.0
5 years ago
0.4.0
5 years ago
0.3.0
5 years ago
0.2.0
5 years ago
0.1.0
5 years ago