|
2 | 2 | title: Plugins |
3 | 3 | --- |
4 | 4 |
|
5 | | -Plugins are Node.js packages that implement Gatsby APIs. They enable you to |
6 | | -easily solve common website build problems e.g. setup Sass, add markdown |
7 | | -support, process images, etc. |
| 5 | +One of the best ways to add functionality to Gatsby is through our plugin system. Gatsby is designed to be extensible, which means plugins are able to extend and modify just about everything Gatsby does. |
8 | 6 |
|
9 | | -For larger / complex sites, they let you modularize your site customizations |
10 | | -into site-specific plugins. |
| 7 | +Of the many possibilities, plugins can: |
11 | 8 |
|
12 | | -Gatsby has a large and growing set of plugins. To search/browse official and |
13 | | -community plugins and their documentation, visit the [Plugin Library](/plugins/). |
| 9 | +- add external data or content (e.g. your CMS, static files, a REST API) to your Gatsby GraphQL data |
| 10 | +- transform data from other formats (e.g. Markdown, YAML, CSV) to JSON objects |
| 11 | +- add third-party services (e.g. Google Analytics, Instagram) to your site |
| 12 | +- anything you can dream up! |
14 | 13 |
|
15 | | -For documentation on the different types of plugins and the functionality provided by each, see the [Plugin Authoring page](/docs/plugin-authoring/). |
| 14 | +Gatsby plugins are Node.js packages that implement Gatsby APIs. For larger, more complex sites, plugins let you modularize your site customizations into site-specific plugins. |
16 | 15 |
|
17 | | -For a walkthrough of how to build and publish your own plugin, see the [Source Plugin Tutorial](/docs/source-plugin-tutorial/). |
| 16 | +## Search published plugins |
18 | 17 |
|
19 | | -## How to use Gatsby plugins? |
| 18 | +Gatsby has a large and growing ecosystem of official and community plugins. To browse plugins and their documentation, visit the [Gatsby Plugin Library](/plugins/). |
20 | 19 |
|
21 | | -Gatsby plugins are Node.js packages, so you can install them like other packages in |
22 | | -node using NPM. |
| 20 | +## Learn more about plugins |
23 | 21 |
|
24 | | -For example, `gatsby-transformer-json` is a package which adds support for JSON |
25 | | -files to the Gatsby data layer. |
| 22 | +For documentation with further detail on what comprises a Gatsby plugin (file structure, etc), see the [plugin authoring page](/docs/plugin-authoring/). |
| 23 | + |
| 24 | +## Build and publish a plugin |
| 25 | + |
| 26 | +For a walkthrough of how to build and publish your own plugin, see the [source plugin tutorial](/docs/source-plugin-tutorial/). |
| 27 | + |
| 28 | +## Use a plugin in your site |
| 29 | + |
| 30 | +Gatsby plugins are Node.js packages, so you can install them like other packages in node using NPM. |
| 31 | + |
| 32 | +For example, `gatsby-transformer-json` is a package which adds support for JSON files to the Gatsby data layer. |
26 | 33 |
|
27 | 34 | To install it, in the root of your site you run: |
28 | 35 |
|
29 | | -`npm install --save gatsby-transformer-json` |
| 36 | +```bash |
| 37 | +npm install --save gatsby-transformer-json |
| 38 | +``` |
30 | 39 |
|
31 | | -Then in your site's `gatsby-config.js` you add `gatsby-transformer-json` |
32 | | -to the plugins array like: |
| 40 | +Then in your site's `gatsby-config.js` you add `gatsby-transformer-json` to the plugins array like: |
33 | 41 |
|
34 | 42 | ```javascript |
35 | 43 | module.exports = { |
36 | 44 | plugins: [`gatsby-transformer-json`], |
37 | 45 | } |
38 | 46 | ``` |
39 | 47 |
|
40 | | -Plugins can take options. Examples: |
| 48 | +Plugins can take options. For example: |
41 | 49 |
|
42 | 50 | ```javascript |
43 | 51 | module.exports = { |
|
0 commit comments