Skip to content

Commit beb3046

Browse files
teleazizEkwuno
andauthored
[Docs] add sourcing from builder.io doc (#22650)
* [Docs] add sourcing from builder.io docs, and link to starter repo * tags * typo * remove failing build files * Update docs/docs/sourcing-from-builder-io.md Co-Authored-By: Obinna Ekwuno <[email protected]> * Update docs/docs/sourcing-from-builder-io.md Co-Authored-By: Obinna Ekwuno <[email protected]> * Update docs/docs/sourcing-from-builder-io.md Co-Authored-By: Obinna Ekwuno <[email protected]> * prettier * Apply suggestions from code review Co-Authored-By: Obinna Ekwuno <[email protected]> * feedback: simplify content flow, clarify querying data * fix typo Co-authored-by: Obinna Ekwuno <[email protected]>
1 parent eea7cdb commit beb3046

File tree

2 files changed

+70
-0
lines changed

2 files changed

+70
-0
lines changed

docs/docs/headless-cms.md

+1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ Here are more resources for guides, plugins, and starters for CMS systems you ca
4747
| [Forestry](https://forestry.io/) | [guide](/docs/sourcing-from-forestry/) | | |
4848
| [Gentics Mesh](https://getmesh.io) | [guide](/docs/sourcing-from-gentics-mesh) | | |
4949
| [Seams-CMS](https://seams-cms.com/) | [guide](/docs/sourcing-from-seams-cms) | | |
50+
| [Builder.io](https://www.bulider.io/) | [guide](/docs/sourcing-from-builder-io/) | [docs](/packages/@builder.io/gatsby/) | [starter](https://github.com/BuilderIO/gatsby-starter-builder) |
5051

5152
## How to add new guides to this section
5253

docs/docs/sourcing-from-builder-io.md

+69
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
---
2+
title: Sourcing from Builder.io
3+
---
4+
5+
[Builder.io](https://builder.io) has all the benefits of a modern headless CMS platform, plus the power of an easy to learn drag and drop editor that enables everyone to edit more than just content. Builder + Gatsby empowers your entire team to create performant and fully customizable pages quickly.
6+
7+
<img src="https://imgur.com/HjBWIbv.gif" alt="Editor example" />
8+
9+
---
10+
11+
## Quick Start
12+
13+
### Prerequisites
14+
15+
Make a free account over at [Builder.io](https://www.builder.io/fork-sample-org) and grab your public API key from your [organization page](https://builder.io/account/organization)
16+
17+
### Fresh project:
18+
19+
To start on a fresh project quickly, use the [BuilderIO Gatsby starter](/starters/BuilderIO/gatsby-starter-builder/)
20+
21+
```shell
22+
gatsby new my-builder-site https://github.com/BuilderIO/gatsby-starter-builder
23+
```
24+
25+
### Existing project:
26+
27+
Use [@builder.io/gatsby plugin](/packages/@builder.io/gatsby/) which will expose Builder.io data and optionally generate pages dynamically from a provided templates.
28+
29+
## Query Builder.io data
30+
31+
The `@Builder.io/gatsby` plugin will add `allBuilderModels` to graphQL, under which you can specify which model you'd like to get entries from.
32+
33+
For example to get the entries from your models `myHeader`, `myFooter`:
34+
35+
```graphql
36+
{
37+
allBuilderModels {
38+
myHeader(limit: 1, options: { cachebust: true }) {
39+
content
40+
}
41+
myFooter(limit: 1, options: { cachebust: true }) {
42+
content
43+
}
44+
}
45+
}
46+
```
47+
48+
Or you can query by urlPath for your page models:
49+
50+
```graphql
51+
query($path: String!) {
52+
allBuilderModels {
53+
myPageModel(
54+
target: { urlPath: $path }
55+
limit: 1
56+
options: { cachebust: true }
57+
) {
58+
content
59+
}
60+
}
61+
}
62+
```
63+
64+
## Learn more
65+
66+
- [Builder.io GraphQL docs](https://www.builder.io/c/docs/graphql-api)
67+
- [@builder.io/gatsby plugin](/packages/@builder.io/gatsby/)
68+
- [Design system example](https://github.com/BuilderIO/builder/tree/master/examples/react-design-system)
69+
- [Official docs](https://www.builder.io/c/docs/getting-started)

0 commit comments

Comments
 (0)