Skip to content

Commit 8741f06

Browse files
marceleq27Marcy Suttongatsbybot
authored
fix(docs): Info about required schemas in plugin (gatsbyjs#24520)
* fix info about required schemas in plugin * fix typo * Update docs/docs/sourcing-from-prismic.md Add suggestion Co-authored-by: Marcy Sutton <[email protected]> * chore: format Co-authored-by: Marcy Sutton <[email protected]> Co-authored-by: gatsbybot <[email protected]>
1 parent 7890dae commit 8741f06

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

docs/docs/sourcing-from-prismic.md

+3
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ _Note: If you want to locally build your project you'll also have to create a `.
5858

5959
Now you need to configure the plugin (See all [available options](https://www.npmjs.com/package/gatsby-source-prismic#how-to-use)). The `repositoryName` is the name you have entered at the creation of the repository (you'll also find it as the subdomain in the URL). The `linkResolver` function is used to process links in your content. Fields with rich text formatting or links to internal content use this function to generate the correct link URL. The document node, field key (i.e. API ID), and field value are provided to the function. This allows you to use different [link resolver logic](https://prismic.io/docs/javascript/query-the-api/link-resolving) for each field if necessary.
6060

61+
Remember also to add an object of Prismic custom type JSON schemas. You can copy it from Prismic's JSON editor tab in your custom type page. It's important to keep the name of JSON file **the same** as your custom type's API ID. More information can be found in the [Prismic documentation](https://user-guides.prismic.io/en/articles/380227-introduction-to-custom-type-building) and [Source Plugin README](/packages/gatsby-source-prismic/#providing-json-schemas).
62+
6163
Add the following to register the plugin:
6264

6365
```javascript:title=gatsby-config.js
@@ -73,6 +75,7 @@ module.exports = {
7375
repositoryName: `your-repository-name`,
7476
accessToken: `${process.env.API_KEY}`,
7577
linkResolver: ({ node, key, value }) => post => `/${post.uid}`,
78+
page: require("./src/schemas/page.json"),
7679
},
7780
},
7881
],

0 commit comments

Comments
 (0)