You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 16, 2026. It is now read-only.
Copy file name to clipboardExpand all lines: src/docs/documentation/customizing/gatsby-theme.mdx
+21-14Lines changed: 21 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,18 +7,19 @@ menu: Customizing
7
7
8
8
# Gatsby Theme
9
9
10
-
If you want to use Docz in a Gatsby environment, use our `gatsby-theme-docz` is the better choice.
10
+
If you want to use Docz in a Gatsby application, you can use `gatsby-theme-docz`.
11
11
12
12
Gatsby themes is one of the coolest features of all time in Gatsby. With the introduction of theming in Gatsby, it's easier than ever to get started building a Gatsby site. Shared functionality, data sourcing, and design can all be prepackaged as a Gatsby Theme that's an NPM install away.
13
13
14
14
Our theme has all components and algorithms used to render your documentation website, with it we can explore a lot of Gatsby features and put all this things together in order
15
-
to create a really usefull documentation for you. Because of `gatsby-theme-docz` you can enjoy of a lot easier system to customize and improve your docs too.
15
+
to create a really useful documentation website.
16
+
With `gatsby-theme-docz` you can get the full power of docz in your existing Gatsby app.
16
17
17
-
If you like it, but you don't know what is a Gatsby theme, please read [the official docs](https://www.gatsbyjs.org/docs/themes/introduction/)
18
+
If you're not sure what a Gatsby theme is, please read [the official docs](https://www.gatsbyjs.org/docs/themes/introduction/)
18
19
19
20
## How to use
20
21
21
-
It's so simple to use our Gatsby theme. First of all, just install some packages:
@@ -59,7 +60,7 @@ If everything works, you should see something like this:
59
60
## Configuration
60
61
61
62
Set your config by using `doczrc.js` file ([see all available](https://www.docz.site/docs/project-configuration)) or if you want to
62
-
set some defaults for your theme, use `options`on plugin definition:
63
+
set some defaults for your theme, use `options`in the plugin definition:
63
64
64
65
```js
65
66
// gatsby-config.js
@@ -92,7 +93,7 @@ export default {
92
93
93
94
## Customizing components
94
95
95
-
Components shadowing is one of the best things included in the new Gatsby theme feature, with itis possible to replace theme files just by creating your own file following a file naming convetion.
96
+
Components shadowing is one of the best things included in the new Gatsby theme feature, with it, it is possible to replace theme files just by creating your own file following a file naming convention.
96
97
97
98
Example: If you're using our `gatsby-theme-docz` which has a `Header` component located at `src/components/Header/index.js` you can override the component by creating `src/gatsby-theme-docz/components/Header/index.js`. Cool right?
98
99
@@ -112,7 +113,11 @@ Easy, right?
112
113
113
114
## Creating your own Docz theme
114
115
115
-
One of the coolest thing of Docz is that you can create your own theme if you want from scratch and use all benefits of it. The oldest way to acomplish that is by using the `theme` property inside the `doczrc.js` file. Now, if you want to create your own theme, just create a file located at `src/gatsby-theme-docz/index.js`
116
+
One of the coolest thing of Docz is that you can create your own theme if you want from scratch and keep all docz's benefits.
117
+
118
+
Previously, this was accomplished by using the `theme` property inside the `doczrc.js` file.
119
+
120
+
Starting from v2, if you want to create your own theme, just create a file located at `src/gatsby-theme-docz/index.js`
As default theme system we are using the [Theme-UI](https://theme-ui.com/), it's a library for build consistent, themeable React apps based on constraint-based design principles.
178
+
Docz's code uses [Theme-UI](https://theme-ui.com/) as the default theme system.
179
+
180
+
[Theme-UI](https://theme-ui.com/) is a library for building consistent, themeable React apps based on constraint-based design principles.
174
181
175
-
You can modify our based theme creating your own style, combining these modifications with the component shadowing and creating a totally differente documentation.
182
+
You can modify the default theme and create your own style by combining these modifications with component shadowing.
176
183
177
184
Check our [base theme object](https://github.com/pedronauck/docz/blob/feat/gatsby/core/gatsby-theme-docz/src/theme/index.js) to see the properties.
178
185
@@ -191,7 +198,7 @@ export default {
191
198
}
192
199
```
193
200
194
-
Or, to create your own theme it's easy, just create this file in the root of your project: `src/gatsby-theme-docz/theme/index.js`.
201
+
Or, to create your own theme, just create this file in the root of your project: `src/gatsby-theme-docz/theme/index.js`.
Both code highlights shortcodes and the `<Playground>` component are using[prism-react-renderer](https://github.com/FormidableLabs/prism-react-renderer) to highlight the code.
218
+
Both code highlights shortcodes and the `<Playground>` component use[prism-react-renderer](https://github.com/FormidableLabs/prism-react-renderer) to highlight the code.
212
219
If you want to modify and use another PrismJS theme, you can do that just passing a `prismTheme` property for your theme.
213
220
214
221
```js
@@ -260,11 +267,11 @@ export default {
260
267
261
268
## Getting data
262
269
263
-
Using our Gatsby Theme you can enjoy all our hooks to get data for your pages and also get data from Gatsby.
270
+
Using our Gatsby Theme you can use all Gatsby hooks to get data for your pages and from Gatsby.
264
271
So, you can create isolated pages on Gatsby using gatsby pages and get data from Docz or maybe pass data
265
272
for your Docz documents using source from gatsby.
266
273
267
-
Imagine, that you have your home page inside `/pages` and you want to show all documents parsed from Docz. You can easy get this by doing:
274
+
Imagine, that you have your home page inside `/pages` and you want to show all documents parsed from Docz. You can get this by doing:
Copy file name to clipboardExpand all lines: src/docs/documentation/customizing/powered-by-gatsby.mdx
+27-23Lines changed: 27 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,50 +8,54 @@ menu: Customizing
8
8
# Powered by Gatsby
9
9
10
10
[Gatsby](https://gatsbyjs.org) is a blazing fast modern site generator for React and one of the greatest modern tools
11
-
of the new frontend era. It has a huge ecosystem and community around it and a very concise team behind.
11
+
of the new frontend era. It has a huge ecosystem and community around it and a very talented team behind it.
12
12
13
-
The Docz core since the new v2 is entirely build around Gatsby, this is the biggest change
13
+
Starting from v2, docz's core is entirely built around Gatsby, this is the biggest change
14
14
in the project since its creation and one of the best things that we could make for the tool.
15
15
16
-
Using Gatsby as bundler behind the scenes we won a lot of benefits like:
16
+
Using Gatsby as bundler behind the scenes gives you a lot of benefits like:
17
17
18
-
* Stay focused in create features instead of lead with bundler management
18
+
* Stay focused on creating features instead of worrying about bundler management
19
19
* Static and optimized builds by default
20
20
* Fast dev-experience and better workflow
21
21
* Huge ecosystem of tools, plugins and community
22
22
* Better and easy way to customize things inside Docz
23
-
* More power in order to create your documentation
24
23
25
24
## Gatsby API and Hooks
26
25
27
-
Gatsby has a pretty damn good [API for developers](https://www.gatsbyjs.org/docs/api-reference/) and a lot of hooks and life cycle methods that you can use in order to customize the process of
28
-
your bundle. Indeed you can hook into it in a lot of ways and all these hooks
29
-
and properties you can use with Docz.
26
+
Gatsby has an extensive [API for developers](https://www.gatsbyjs.org/docs/api-reference/) and a lot of hooks and lifecycle methods that you can use in order to customize your build process.
30
27
31
-
> Check [all Gatsby API references](https://www.gatsbyjs.org/docs/api-reference/) here
28
+
You can hook into it in a lot of ways and all of these hooks and properties are available when you use docz.
32
29
33
-
So, if you want to use any of those Gatsby configurations file inside your Docz project, create it in the root and we'll handle them for you.
30
+
> Check [the Gatsby API reference](https://www.gatsbyjs.org/docs/api-reference/) here.
34
31
35
-
If you want to make some change in the webpack configuration, you can use
36
-
the `onCreateWebpackConfig` hook inside the `gatsby-node.js` file:
32
+
If you want to use any of those Gatsby configurations file inside your Docz project,
33
+
create it in the root and docz will do the rest.
34
+
35
+
If you want to make some changes to your webpack configuration, you can use
36
+
the `onCreateWebpackConfig` hook by exporting a function from the `gatsby-node.js` file.
37
+
38
+
For example to create aliases or change how your modules are resolved, you can do something like the below example :
0 commit comments