GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Update Readme with information for multiple spaces (#21740) · gatsbyjs/gatsby@94247c1

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • packages/gatsby-source-contentful
    • README.md
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎packages/gatsby-source-contentful/README.md‎

Copy file name to clipboardExpand all lines: packages/gatsby-source-contentful/README.md
+26Lines changed: 26 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -392,5 +392,31 @@ documentToReactComponents(node.bodyRichText.json, options)
392392

393393
Check out the examples at [@contentful/rich-text-react-renderer](https://github.com/contentful/rich-text/tree/master/packages/rich-text-react-renderer).
394394

395+
## Sourcing From Multiple Contentful Spaces
396+
397+
To source from multiple Contentful environments/spaces, add another configuration for `gatsby-source-contentful` in `gatsby-config.js`:
398+
399+
```
400+
// In your gatsby-config.js
401+
module.exports = {
402+
plugins: [
403+
{
404+
resolve: `gatsby-source-contentful`,
405+
options: {
406+
spaceId: `your_space_id`,
407+
accessToken: process.env.CONTENTFUL_ACCESS_TOKEN,
408+
},
409+
},
410+
{
411+
resolve: `gatsby-source-contentful`,
412+
options: {
413+
spaceId: `your_second_space_id`,
414+
accessToken: process.env.SECONDARY_CONTENTFUL_ACCESS_TOKEN,
415+
},
416+
}
417+
],
418+
}
419+
```
420+
395421
[dotenv]: https://github.com/motdotla/dotenv
396422
[envvars]: https://gatsby.dev/env-vars

0 commit comments

Comments
0 (0)
You are visitor 01402911 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.