https://github.com/gitana/gatsby-source-cloudcms
Gatsby source plugin for Cloud CMS
https://github.com/gitana/gatsby-source-cloudcms
Last synced: about 1 year ago
JSON representation
Gatsby source plugin for Cloud CMS
- Host: GitHub
- URL: https://github.com/gitana/gatsby-source-cloudcms
- Owner: gitana
- Created: 2019-02-08T20:55:54.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2021-11-15T14:55:10.000Z (over 4 years ago)
- Last Synced: 2024-12-25T20:23:45.465Z (over 1 year ago)
- Language: JavaScript
- Size: 66.4 KB
- Stars: 0
- Watchers: 7
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# gatsby-source-cloudcms
Source plugin for adding your cloudcms content and attachments into your Gatsby.js site
## Install
```
npm install gatsby-source-cloudcms
or
yarn add gatsby-source-cloudcms
```
## Usage
```js
// In your gatsby-config.js
const gitanaJson = require('./gitana.json');
module.exports = {
plugins: [
{
resolve: `gatsby-source-cloudcms`,
options: {
keys: gitanaJson,
repositoryId: `myRepositoryId`,
branchId: `myBranchId`
}
}
]
}
```
Note that you will need to provide [API Keys](https://www.cloudcms.com/documentation/apikeys.html) to cloudcms, as well as a
`repositoryId` and `branchId` ([Help](https://support.cloudcms.com/hc/en-us/articles/360005276393-How-to-find-the-Repository-ID-for-a-Project-)).
You can additionally provide a `contentQuery` to options with MongoDB syntax to specify what subset of your content to source.
For example, if my site only contained content of type `store:book` and `store:author`, I could use the following `contentQuery`:
```
{
"_type": {
"$in": ["store:book", "store:author"]
}
}
```
[More on queries](https://www.cloudcms.com/documentation/query.html)
[Example CloudCMS Gatsby Site](https://github.com/gitana/sdk/tree/master/gatsbyjs/sample)