# gatsby-source-netlify-cms

> #### setting up your `gatsby-config.js`

Latest version **0.10.5** (published 2019-10-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install gatsby-source-netlify-cms
pnpm add gatsby-source-netlify-cms
yarn add gatsby-source-netlify-cms
bun add gatsby-source-netlify-cms
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.10.5 |
| Published | 2019-10-20 |
| First published | 2019-07-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 9 |
| Unpacked size | 23.8 KB |
| Known vulnerabilities | 0 (+4 in 3 direct dependencies) |
| Install scripts | no |
| Author | Tony Alves |
| Maintainers | talves |
| Keywords | gatsby, gatsby-plugin |

## Links

- npm: https://www.npmjs.com/package/gatsby-source-netlify-cms
- npm.io page: https://npm.io/package/gatsby-source-netlify-cms

## Dependencies (9)

- [toml](https://npm.io/package/toml.md) ^3.0.0
- [mkdirp](https://npm.io/package/mkdirp.md) ^0.5.1
- [js-yaml](https://npm.io/package/js-yaml.md) ^3.13.1
- [fs-extra](https://npm.io/package/fs-extra.md) ^8.1.0
- [@mdx-js/mdx](https://npm.io/package/@mdx-js/mdx.md) ^1.0.0
- [@mdx-js/react](https://npm.io/package/@mdx-js/react.md) ^1.0.0
- [@babel/runtime](https://npm.io/package/@babel/runtime.md) ^7.0.0
- [gatsby-plugin-mdx](https://npm.io/package/gatsby-plugin-mdx.md) ^1.0.16
- [gatsby-transformer-remark](https://npm.io/package/gatsby-transformer-remark.md) ^2.6.5

## Recent versions

- 0.10.5 (latest) — 2019-10-20
- 0.10.4 — 2019-08-13
- 0.10.3 — 2019-08-09
- 0.10.0 — 2019-07-31
- 0.9.6 — 2019-07-31
- 0.9.5 — 2019-07-31
- 0.9.4 — 2019-07-31
- 0.9.3 — 2019-07-30
- 0.9.2 — 2019-07-30
- 0.9.1 — 2019-07-29
- 0.9.0 — 2019-07-29
- 0.8.2 — 2019-07-28
- 0.8.1 — 2019-07-26
- 0.8.0 — 2019-07-25
- 0.7.4 — 2019-07-22
- … 9 more at https://npm.io/package/gatsby-source-netlify-cms/versions

## README

## gastby-source-netlify-cms (Beta)

#### setting up your `gatsby-config.js`

Default setup uses the helper functions imported from the plugin.

```javascript
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 helper `createPluginPaths`
- 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` during `createSchemaCustomization` and using the `options.types` created by `createPluginOptions`
- Plugin creates the nodes during `onCreateNode` using the nodes created by `gatsby-source-filesystem` setup by `createPluginPaths` and the types configuration created by `createPluginOptions`
- All the options and plugins can be configured manually if a more advanced naming of nodes and types is needed.

---
_Source: https://npm.io/package/gatsby-source-netlify-cms · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
