From 791623c691acabdbe34592bc26b18f339fb2d0cf Mon Sep 17 00:00:00 2001 From: Ekwuno Obinna Date: Mon, 2 Mar 2020 16:24:59 +0100 Subject: [PATCH 1/5] Rename Theme tutorials to Plugin and Theme Tutorials and update redirect links --- docs/blog/100days/start-blog/index.md | 2 +- docs/contributing/docs-contributions.md | 2 +- docs/docs/gatsby-vendor-partnership.md | 2 +- docs/docs/naming-a-plugin.md | 2 +- docs/docs/recipes/sourcing-data.md | 2 +- docs/docs/schema-gql-type.md | 2 +- docs/docs/sourcing-from-private-apis.md | 2 +- docs/docs/themes.md | 2 +- docs/tutorial/index.md | 2 +- docs/{docs => tutorial}/pixabay-source-plugin-tutorial.md | 0 docs/{docs => tutorial}/remark-plugin-tutorial.md | 2 +- docs/tutorial/theme-tutorials.md | 2 +- examples/using-local-plugins/README.md | 2 +- packages/gatsby-cli/src/create-cli.js | 2 +- www/redirects.yaml | 6 +++++- www/src/data/sidebars/doc-links.yaml | 4 ++-- www/src/data/sidebars/tutorial-links.yaml | 2 +- 17 files changed, 21 insertions(+), 17 deletions(-) rename docs/{docs => tutorial}/pixabay-source-plugin-tutorial.md (100%) rename docs/{docs => tutorial}/remark-plugin-tutorial.md (99%) diff --git a/docs/blog/100days/start-blog/index.md b/docs/blog/100days/start-blog/index.md index 900500df2f63f..33c330d2c024c 100644 --- a/docs/blog/100days/start-blog/index.md +++ b/docs/blog/100days/start-blog/index.md @@ -25,7 +25,7 @@ _Bonus:_ use your new blog to track your #100DaysOfGatsby progress! Research sho To create your blog, start with our [beginner-focused Gatsby tutorials](/tutorial/) and complete lessons 0-8. Depending on your current skill level, erecting a Gatsby blog make take you an afternoon or a full week (or more) to complete. -If you are already familiar with Gatsby's APIs and conventions, and want a more advanced challenge, you can [create a Gatsby theme for your blog](/tutorial/theme-tutorials/). +If you are already familiar with Gatsby's APIs and conventions, and want a more advanced challenge, you can [create a Gatsby theme for your blog](/tutorial/plugin-and-theme-tutorials/). ### What to Do If You Need Help diff --git a/docs/contributing/docs-contributions.md b/docs/contributing/docs-contributions.md index 6de9819450881..fd126dfcd3bb9 100644 --- a/docs/contributing/docs-contributions.md +++ b/docs/contributing/docs-contributions.md @@ -190,7 +190,7 @@ Sometimes it makes sense to move or rename a file as part of docs restructuring ```yaml:title=www/redirects.yaml - fromPath: /docs/source-plugin-tutorial/ - toPath: /docs/pixabay-source-plugin-tutorial/ + toPath: /docs/tutorial/pixabay-source-plugin-tutorial.md ``` ## Claim your swag diff --git a/docs/docs/gatsby-vendor-partnership.md b/docs/docs/gatsby-vendor-partnership.md index 77120e9e5684b..32297af4f5f87 100644 --- a/docs/docs/gatsby-vendor-partnership.md +++ b/docs/docs/gatsby-vendor-partnership.md @@ -54,7 +54,7 @@ Current partners have reported development timelines of 2-3 days when the conten If you have a GraphQL-based API, you **may not need to build an integration at all** -- Gatsby supports integration with GraphQL APIs via so-called ["schema stitching"](/blog/2018-09-25-announcing-graphql-stitching-support/). -If you have questions while building your Gatsby integrations, try reading other supporting documentation such as the [general plugin authoring guide](/docs/creating-plugins/) and [source plugin tutorial](/docs/pixabay-source-plugin-tutorial/). +If you have questions while building your Gatsby integrations, try reading other supporting documentation such as the [general plugin authoring guide](/docs/creating-plugins/) and [source plugin tutorial](/docs/tutorial/pixabay-source-plugin-tutorial.md). If you still have questions, please [raise an issue on GitHub](https://github.com/gatsbyjs/gatsby/issues), ask a question in [Discord chat](https://gatsby.dev/discord), or reach out to our team at [developer-relations@gatsbyjs.com](mailto:developer-relations@gatsbyjs.com). diff --git a/docs/docs/naming-a-plugin.md b/docs/docs/naming-a-plugin.md index b92a62c969121..24cffdc0ec08c 100644 --- a/docs/docs/naming-a-plugin.md +++ b/docs/docs/naming-a-plugin.md @@ -14,7 +14,7 @@ There are five standard plugin naming conventions for Gatsby: - Docs: [creating a transformer plugin](/docs/creating-a-transformer-plugin/) - **`gatsby-[plugin-name]-*`** β€” if a plugin is a plugin for another plugin πŸ˜…, it should be prefixed with the name of the plugin it extends (e.g. if it adds emoji to the output of `gatsby-transformer-remark`, call it `gatsby-remark-add-emoji`). Use this naming convention whenever your plugin will be included as a plugin in the `options` object of another plugin. - Example: [`gatsby-remark-images`](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-remark-images) - - Docs: [creating a remark plugin](/docs/remark-plugin-tutorial/) + - Docs: [creating a remark plugin](docs/tutorial/remark-plugin-tutorial.md) - **`gatsby-theme-*`** β€” this naming convention is used for [Gatsby themes](/docs/themes/), which are a type of plugin. This naming convention is used for plugins that own a section, a page, or part of a page on a site or expose files and components for [shadowing](/docs/themes/shadowing/). - Example: [`gatsby-theme-blog`](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-theme-blog) - Docs: [creating a theme](/tutorial/building-a-theme/) diff --git a/docs/docs/recipes/sourcing-data.md b/docs/docs/recipes/sourcing-data.md index 07fcd0f21ec6e..2477c73ea8be7 100644 --- a/docs/docs/recipes/sourcing-data.md +++ b/docs/docs/recipes/sourcing-data.md @@ -59,7 +59,7 @@ query MyPokemonQuery { - Walk through an example using the `gatsby-source-filesystem` plugin in [tutorial part five](/tutorial/part-five/#source-plugins) - Search available source plugins in the [Gatsby library](/plugins/?=source) -- Understand source plugins by building one in the [Pixabay source plugin tutorial](/docs/pixabay-source-plugin-tutorial/) +- Understand source plugins by building one in the [Pixabay source plugin tutorial](/docs/tutorial/pixabay-source-plugin-tutorial.md) - The createNode function [documentation](/docs/actions/#createNode) ## Sourcing Markdown data for blog posts and pages with GraphQL diff --git a/docs/docs/schema-gql-type.md b/docs/docs/schema-gql-type.md index 53c56630bce04..33082fc7dd4d0 100644 --- a/docs/docs/schema-gql-type.md +++ b/docs/docs/schema-gql-type.md @@ -106,7 +106,7 @@ Now we can create a GraphQL Field declaration whose type is `AuthorYaml` (which #### Foreign Key reference (`___NODE`) -If not a mapping field, it might instead end in `___NODE`, signifying that its value is an ID that is a foreign key reference to another node in redux. Check out the [Source Plugin Tutorial](/docs/pixabay-source-plugin-tutorial/) for how this works from a user point of view. Behind the scenes, the field inference is handled by [inferFromFieldName](https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby/src/schema/infer-graphql-type.js#L204). +If not a mapping field, it might instead end in `___NODE`, signifying that its value is an ID that is a foreign key reference to another node in redux. Check out the [Source Plugin Tutorial](/docs/tutorial/pixabay-source-plugin-tutorial.md) for how this works from a user point of view. Behind the scenes, the field inference is handled by [inferFromFieldName](https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby/src/schema/infer-graphql-type.js#L204). This is actually quite similar to the mapping case above. We remove the `___NODE` part of the field name. E.g. `author___NODE` would become `author`. Then, we find our `linkedNode`. I.e given the example value for `author` (which would be an ID), we find its actual node in redux. Then, we find its type in processed types by its `internal.type`. Note, that also like in mapping fields, we can define the `linkedField` too. This can be specified via `nodeFieldname___NODE___linkedFieldName`. E.g. for `author___NODE___name`, the linkedField would be `name` instead of `id`. diff --git a/docs/docs/sourcing-from-private-apis.md b/docs/docs/sourcing-from-private-apis.md index 1eca3f5d5ac9f..3e88290b32938 100644 --- a/docs/docs/sourcing-from-private-apis.md +++ b/docs/docs/sourcing-from-private-apis.md @@ -10,7 +10,7 @@ There are 3 approaches that you can use to source data from your private API: 1. If your private API is a GraphQL API, you can use [`gatsby-source-graphql`](/packages/gatsby-source-graphql/). 2. If your private API is not a GraphQL API and you are new to GraphQL, treat the data as unstructured data and fetch it during build time, as described by the guide "[Using Gatsby without GraphQL](/docs/using-gatsby-without-graphql/)". However, as highlighted in the guide, this approach comes with some tradeoffs. -3. Create a source plugin, as described in the tutorial "[Source plugin tutorial](/docs/pixabay-source-plugin-tutorial/)". +3. Create a source plugin, as described in the tutorial "[Source plugin tutorial](/docs/tutorial/pixabay-source-plugin-tutorial.md)". ## Other considerations diff --git a/docs/docs/themes.md b/docs/docs/themes.md index 455d40f82a9b1..331b9f587ff92 100644 --- a/docs/docs/themes.md +++ b/docs/docs/themes.md @@ -17,6 +17,6 @@ This means that the configuration and functionality isn’t directly written int ## Other resources -- [Gatsby theme tutorials](/tutorial/theme-tutorials/) +- [Gatsby theme tutorials](/tutorial/plugin-and-theme-tutorials/) - [Gatsby blog posts on themes](/blog/tags/themes) - [Plugins, Themes, and Starters](/docs/plugins-themes-and-starters/) diff --git a/docs/tutorial/index.md b/docs/tutorial/index.md index 093719905d01f..1e6c692a88fc9 100644 --- a/docs/tutorial/index.md +++ b/docs/tutorial/index.md @@ -30,7 +30,7 @@ Gatsby themes abstract all of your default configuration (shared functionality, This means that the configuration and functionality aren’t directly written into your project, but rather versioned, centrally managed, and installed as a dependency. You can seamlessly update a theme, compose themes together, and even swap out one compatible theme for another. -Learn more about using and building themes with the [Gatsby theme tutorials](/tutorial/theme-tutorials/). +Learn more about using and building themes with the [Gatsby theme tutorials](/tutorial/plugin-and-theme-tutorials/). ## Additional tutorials diff --git a/docs/docs/pixabay-source-plugin-tutorial.md b/docs/tutorial/pixabay-source-plugin-tutorial.md similarity index 100% rename from docs/docs/pixabay-source-plugin-tutorial.md rename to docs/tutorial/pixabay-source-plugin-tutorial.md diff --git a/docs/docs/remark-plugin-tutorial.md b/docs/tutorial/remark-plugin-tutorial.md similarity index 99% rename from docs/docs/remark-plugin-tutorial.md rename to docs/tutorial/remark-plugin-tutorial.md index 1639cf4a6b4e5..0c6ada7652b82 100644 --- a/docs/docs/remark-plugin-tutorial.md +++ b/docs/tutorial/remark-plugin-tutorial.md @@ -16,7 +16,7 @@ In certain instances, a developer may want to customize the content of the Markd There a few things that you should have some understanding with: -- How to work with Remark in Gatsby as described in [Part Six](/tutorial/part-six/) and [Part Seven](/tutorial/part-seven/) of the Gatsby Tutorial. +- How to work with Remark in Gatsby as described in [Part Six](/tutorial/part-six) and [Part Seven](/tutorial/part-seven/) of the Gatsby Tutorial. - Understanding of the Markdown Syntax. ## Understanding the Abstract Syntax Tree diff --git a/docs/tutorial/theme-tutorials.md b/docs/tutorial/theme-tutorials.md index 06f1d66c697cb..1b4d97dd53158 100644 --- a/docs/tutorial/theme-tutorials.md +++ b/docs/tutorial/theme-tutorials.md @@ -1,5 +1,5 @@ --- -title: Theme Tutorials +title: Plugin and Theme Tutorials --- Gatsby themes are a new way to encapsulate, re-use, and compose Gatsby functionality. diff --git a/examples/using-local-plugins/README.md b/examples/using-local-plugins/README.md index 35dd1495b54cd..48daef49d2725 100755 --- a/examples/using-local-plugins/README.md +++ b/examples/using-local-plugins/README.md @@ -2,7 +2,7 @@ This example demonstrates usage of a local plugin -- in this case a source plugin. -You might also be interested in the docs section on [local plugins](/docs/creating-a-local-plugin/), or the [source plugin tutorial](/docs/pixabay-source-plugin-tutorial/). +You might also be interested in the docs section on [local plugins](/docs/creating-a-local-plugin/), or the [source plugin tutorial](/docs/tutorial/pixabay-source-plugin-tutorial.md). ## Using Gatsby's GraphQL integration layer diff --git a/packages/gatsby-cli/src/create-cli.js b/packages/gatsby-cli/src/create-cli.js index 75e851cd9a7ae..9c7974f750df3 100644 --- a/packages/gatsby-cli/src/create-cli.js +++ b/packages/gatsby-cli/src/create-cli.js @@ -386,7 +386,7 @@ Creating a plugin: - Creating a Source Plugin (https://www.gatsbyjs.org/docs/creating-a-source-plugin/) - Creating a Transformer Plugin (https://www.gatsbyjs.org/docs/creating-a-transformer-plugin/) - Submit to Plugin Library (https://www.gatsbyjs.org/contributing/submit-to-plugin-library/) -- Pixabay Source Plugin Tutorial (https://www.gatsbyjs.org/docs/pixabay-source-plugin-tutorial/) +- Pixabay Source Plugin Tutorial (https://www.gatsbyjs.org/docs/tutorial/pixabay-source-plugin-tutorial.md) - Maintaining a Plugin (https://www.gatsbyjs.org/docs/maintaining-a-plugin/) - Join Discord #plugin-authoring channel to ask questions! (https://gatsby.dev/discord/) `) diff --git a/www/redirects.yaml b/www/redirects.yaml index 32638e29d998d..800fcb6856bc5 100644 --- a/www/redirects.yaml +++ b/www/redirects.yaml @@ -76,8 +76,12 @@ toPath: /docs/creating-a-transformer-plugin/ - fromPath: /docs/plugin-authoring/ toPath: /docs/how-plugins-work/ +- fromPath: /tutorial/theme-tutorials + toPath: /tutorial/plugin-and-theme-tutorials +- fromPath: docs/remark-plugin-tutorial.md + toPath: docs/tutorial/remark-plugin-tutorial.md - fromPath: /docs/source-plugin-tutorial/ - toPath: /docs/pixabay-source-plugin-tutorial/ + toPath: /docs/tutorial/pixabay-source-plugin-tutorial.md - fromPath: /docs/how-plugins-work/ toPath: /docs/plugins/ - fromPath: /blog/2018-2-16-how-to-build-a-website-with-react/ diff --git a/www/src/data/sidebars/doc-links.yaml b/www/src/data/sidebars/doc-links.yaml index f54f11500cd74..2d23f7f7a89e6 100644 --- a/www/src/data/sidebars/doc-links.yaml +++ b/www/src/data/sidebars/doc-links.yaml @@ -264,9 +264,9 @@ - title: Submit to Plugin Library link: /contributing/submit-to-plugin-library/ - title: Pixabay Image Source Plugin Tutorial - link: /docs/pixabay-source-plugin-tutorial/ + link: /docs/tutorial/pixabay-source-plugin-tutorial.md - title: Remark Plugin Tutorial - link: /docs/remark-plugin-tutorial/ + link: docs/tutorial/remark-plugin-tutorial.md - title: Maintaining a Plugin link: /docs/maintaining-a-plugin/ - title: Themes diff --git a/www/src/data/sidebars/tutorial-links.yaml b/www/src/data/sidebars/tutorial-links.yaml index 0bf49f5528bd2..cedb81fd1874c 100644 --- a/www/src/data/sidebars/tutorial-links.yaml +++ b/www/src/data/sidebars/tutorial-links.yaml @@ -111,7 +111,7 @@ - title: Keep making it better link: /tutorial/part-eight/#keep-making-it-better - title: Theme Tutorials - link: /tutorial/theme-tutorials/ + link: /tutorial/plugin-and-theme-tutorials/ items: - title: Using a Theme link: /tutorial/using-a-theme/ From 7ec38916479bcaed902f5ed9a2aab76e5c637811 Mon Sep 17 00:00:00 2001 From: Ekwuno Obinna Date: Mon, 2 Mar 2020 23:37:12 +0100 Subject: [PATCH 2/5] replace .md with / on links so the to path will include links --- docs/contributing/docs-contributions.md | 2 +- docs/docs/gatsby-vendor-partnership.md | 2 +- docs/docs/naming-a-plugin.md | 2 +- docs/docs/recipes/sourcing-data.md | 2 +- docs/docs/schema-gql-type.md | 3 ++- docs/docs/sourcing-from-private-apis.md | 2 +- docs/tutorial/remark-plugin-tutorial.md | 2 +- docs/tutorial/theme-tutorials.md | 6 ++++-- examples/using-local-plugins/README.md | 2 +- packages/gatsby-cli/src/create-cli.js | 2 +- www/redirects.yaml | 2 +- www/src/data/sidebars/doc-links.yaml | 4 ++-- www/src/data/sidebars/tutorial-links.yaml | 2 +- 13 files changed, 18 insertions(+), 15 deletions(-) diff --git a/docs/contributing/docs-contributions.md b/docs/contributing/docs-contributions.md index fd126dfcd3bb9..5c105281738de 100644 --- a/docs/contributing/docs-contributions.md +++ b/docs/contributing/docs-contributions.md @@ -190,7 +190,7 @@ Sometimes it makes sense to move or rename a file as part of docs restructuring ```yaml:title=www/redirects.yaml - fromPath: /docs/source-plugin-tutorial/ - toPath: /docs/tutorial/pixabay-source-plugin-tutorial.md + toPath: /docs/tutorial/pixabay-source-plugin-tutorial/ ``` ## Claim your swag diff --git a/docs/docs/gatsby-vendor-partnership.md b/docs/docs/gatsby-vendor-partnership.md index 32297af4f5f87..069bfa4eb8712 100644 --- a/docs/docs/gatsby-vendor-partnership.md +++ b/docs/docs/gatsby-vendor-partnership.md @@ -54,7 +54,7 @@ Current partners have reported development timelines of 2-3 days when the conten If you have a GraphQL-based API, you **may not need to build an integration at all** -- Gatsby supports integration with GraphQL APIs via so-called ["schema stitching"](/blog/2018-09-25-announcing-graphql-stitching-support/). -If you have questions while building your Gatsby integrations, try reading other supporting documentation such as the [general plugin authoring guide](/docs/creating-plugins/) and [source plugin tutorial](/docs/tutorial/pixabay-source-plugin-tutorial.md). +If you have questions while building your Gatsby integrations, try reading other supporting documentation such as the [general plugin authoring guide](/docs/creating-plugins/) and [source plugin tutorial](/docs/tutorial/pixabay-source-plugin-tutorial/). If you still have questions, please [raise an issue on GitHub](https://github.com/gatsbyjs/gatsby/issues), ask a question in [Discord chat](https://gatsby.dev/discord), or reach out to our team at [developer-relations@gatsbyjs.com](mailto:developer-relations@gatsbyjs.com). diff --git a/docs/docs/naming-a-plugin.md b/docs/docs/naming-a-plugin.md index 24cffdc0ec08c..fbc2e02b4bce5 100644 --- a/docs/docs/naming-a-plugin.md +++ b/docs/docs/naming-a-plugin.md @@ -14,7 +14,7 @@ There are five standard plugin naming conventions for Gatsby: - Docs: [creating a transformer plugin](/docs/creating-a-transformer-plugin/) - **`gatsby-[plugin-name]-*`** β€” if a plugin is a plugin for another plugin πŸ˜…, it should be prefixed with the name of the plugin it extends (e.g. if it adds emoji to the output of `gatsby-transformer-remark`, call it `gatsby-remark-add-emoji`). Use this naming convention whenever your plugin will be included as a plugin in the `options` object of another plugin. - Example: [`gatsby-remark-images`](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-remark-images) - - Docs: [creating a remark plugin](docs/tutorial/remark-plugin-tutorial.md) + - Docs: [creating a remark plugin](docs/tutorial/remark-plugin-tutorial/) - **`gatsby-theme-*`** β€” this naming convention is used for [Gatsby themes](/docs/themes/), which are a type of plugin. This naming convention is used for plugins that own a section, a page, or part of a page on a site or expose files and components for [shadowing](/docs/themes/shadowing/). - Example: [`gatsby-theme-blog`](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-theme-blog) - Docs: [creating a theme](/tutorial/building-a-theme/) diff --git a/docs/docs/recipes/sourcing-data.md b/docs/docs/recipes/sourcing-data.md index 2477c73ea8be7..174b786fcc15b 100644 --- a/docs/docs/recipes/sourcing-data.md +++ b/docs/docs/recipes/sourcing-data.md @@ -59,7 +59,7 @@ query MyPokemonQuery { - Walk through an example using the `gatsby-source-filesystem` plugin in [tutorial part five](/tutorial/part-five/#source-plugins) - Search available source plugins in the [Gatsby library](/plugins/?=source) -- Understand source plugins by building one in the [Pixabay source plugin tutorial](/docs/tutorial/pixabay-source-plugin-tutorial.md) +- Understand source plugins by building one in the [Pixabay source plugin tutorial](/docs/tutorial/pixabay-source-plugin-tutorial/) - The createNode function [documentation](/docs/actions/#createNode) ## Sourcing Markdown data for blog posts and pages with GraphQL diff --git a/docs/docs/schema-gql-type.md b/docs/docs/schema-gql-type.md index 33082fc7dd4d0..9367227239fd6 100644 --- a/docs/docs/schema-gql-type.md +++ b/docs/docs/schema-gql-type.md @@ -106,7 +106,8 @@ Now we can create a GraphQL Field declaration whose type is `AuthorYaml` (which #### Foreign Key reference (`___NODE`) -If not a mapping field, it might instead end in `___NODE`, signifying that its value is an ID that is a foreign key reference to another node in redux. Check out the [Source Plugin Tutorial](/docs/tutorial/pixabay-source-plugin-tutorial.md) for how this works from a user point of view. Behind the scenes, the field inference is handled by [inferFromFieldName](https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby/src/schema/infer-graphql-type.js#L204). +If not a mapping field, it might instead end in `___NODE`, signifying that its value is an ID that is a foreign key reference to another node in redux. Check out the [Source Plugin Tutorial](/docs/tutorial/pixabay-source-plugin-tutorial/) for how this works from a user point of view. Behind the scenes, the field inference is handled by [inferFromFieldName](https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby/src/schema/infer-graphql-type.js#L204). + This is actually quite similar to the mapping case above. We remove the `___NODE` part of the field name. E.g. `author___NODE` would become `author`. Then, we find our `linkedNode`. I.e given the example value for `author` (which would be an ID), we find its actual node in redux. Then, we find its type in processed types by its `internal.type`. Note, that also like in mapping fields, we can define the `linkedField` too. This can be specified via `nodeFieldname___NODE___linkedFieldName`. E.g. for `author___NODE___name`, the linkedField would be `name` instead of `id`. diff --git a/docs/docs/sourcing-from-private-apis.md b/docs/docs/sourcing-from-private-apis.md index 3e88290b32938..e4d7732f7451e 100644 --- a/docs/docs/sourcing-from-private-apis.md +++ b/docs/docs/sourcing-from-private-apis.md @@ -10,7 +10,7 @@ There are 3 approaches that you can use to source data from your private API: 1. If your private API is a GraphQL API, you can use [`gatsby-source-graphql`](/packages/gatsby-source-graphql/). 2. If your private API is not a GraphQL API and you are new to GraphQL, treat the data as unstructured data and fetch it during build time, as described by the guide "[Using Gatsby without GraphQL](/docs/using-gatsby-without-graphql/)". However, as highlighted in the guide, this approach comes with some tradeoffs. -3. Create a source plugin, as described in the tutorial "[Source plugin tutorial](/docs/tutorial/pixabay-source-plugin-tutorial.md)". +3. Create a source plugin, as described in the tutorial "[Source plugin tutorial](/docs/tutorial/pixabay-source-plugin-tutorial/)". ## Other considerations diff --git a/docs/tutorial/remark-plugin-tutorial.md b/docs/tutorial/remark-plugin-tutorial.md index 0c6ada7652b82..1639cf4a6b4e5 100644 --- a/docs/tutorial/remark-plugin-tutorial.md +++ b/docs/tutorial/remark-plugin-tutorial.md @@ -16,7 +16,7 @@ In certain instances, a developer may want to customize the content of the Markd There a few things that you should have some understanding with: -- How to work with Remark in Gatsby as described in [Part Six](/tutorial/part-six) and [Part Seven](/tutorial/part-seven/) of the Gatsby Tutorial. +- How to work with Remark in Gatsby as described in [Part Six](/tutorial/part-six/) and [Part Seven](/tutorial/part-seven/) of the Gatsby Tutorial. - Understanding of the Markdown Syntax. ## Understanding the Abstract Syntax Tree diff --git a/docs/tutorial/theme-tutorials.md b/docs/tutorial/theme-tutorials.md index 1b4d97dd53158..8a72ca50dd404 100644 --- a/docs/tutorial/theme-tutorials.md +++ b/docs/tutorial/theme-tutorials.md @@ -1,8 +1,10 @@ --- -title: Plugin and Theme Tutorials +title: Plugin & Theme Tutorials --- -Gatsby themes are a new way to encapsulate, re-use, and compose Gatsby functionality. +Gatsby plugins are Node.js packages that implement Gatsby APIs and are commonly installed through a registry like npm. Plugins are a way to encapsulate, re-use, and compose Gatsby functionality. A good example of this concept are Gatsby themes which is a type of plugin that includes a `gatsby-config.js` file and adds pre-configured functionality, data sourcing, and/or UI code to Gatsby sites. + +> You can refer to the [conceptual guide on plugins,theme,and starters](/docs/plugins-themes-and-starters/) for more information. In this section, you'll find tutorials for: diff --git a/examples/using-local-plugins/README.md b/examples/using-local-plugins/README.md index 48daef49d2725..61aa15ed1d2d1 100755 --- a/examples/using-local-plugins/README.md +++ b/examples/using-local-plugins/README.md @@ -2,7 +2,7 @@ This example demonstrates usage of a local plugin -- in this case a source plugin. -You might also be interested in the docs section on [local plugins](/docs/creating-a-local-plugin/), or the [source plugin tutorial](/docs/tutorial/pixabay-source-plugin-tutorial.md). +You might also be interested in the docs section on [local plugins](/docs/creating-a-local-plugin/), or the [source plugin tutorial](/docs/tutorial/pixabay-source-plugin-tutorial/). ## Using Gatsby's GraphQL integration layer diff --git a/packages/gatsby-cli/src/create-cli.js b/packages/gatsby-cli/src/create-cli.js index 9c7974f750df3..007740b7bd668 100644 --- a/packages/gatsby-cli/src/create-cli.js +++ b/packages/gatsby-cli/src/create-cli.js @@ -386,7 +386,7 @@ Creating a plugin: - Creating a Source Plugin (https://www.gatsbyjs.org/docs/creating-a-source-plugin/) - Creating a Transformer Plugin (https://www.gatsbyjs.org/docs/creating-a-transformer-plugin/) - Submit to Plugin Library (https://www.gatsbyjs.org/contributing/submit-to-plugin-library/) -- Pixabay Source Plugin Tutorial (https://www.gatsbyjs.org/docs/tutorial/pixabay-source-plugin-tutorial.md) +- Pixabay Source Plugin Tutorial (https://www.gatsbyjs.org/docs/tutorial/pixabay-source-plugin-tutorial/) - Maintaining a Plugin (https://www.gatsbyjs.org/docs/maintaining-a-plugin/) - Join Discord #plugin-authoring channel to ask questions! (https://gatsby.dev/discord/) `) diff --git a/www/redirects.yaml b/www/redirects.yaml index 800fcb6856bc5..81f6cb348268c 100644 --- a/www/redirects.yaml +++ b/www/redirects.yaml @@ -81,7 +81,7 @@ - fromPath: docs/remark-plugin-tutorial.md toPath: docs/tutorial/remark-plugin-tutorial.md - fromPath: /docs/source-plugin-tutorial/ - toPath: /docs/tutorial/pixabay-source-plugin-tutorial.md + toPath: /docs/tutorial/pixabay-source-plugin-tutorial/ - fromPath: /docs/how-plugins-work/ toPath: /docs/plugins/ - fromPath: /blog/2018-2-16-how-to-build-a-website-with-react/ diff --git a/www/src/data/sidebars/doc-links.yaml b/www/src/data/sidebars/doc-links.yaml index 2d23f7f7a89e6..0bced80c6fde4 100644 --- a/www/src/data/sidebars/doc-links.yaml +++ b/www/src/data/sidebars/doc-links.yaml @@ -264,9 +264,9 @@ - title: Submit to Plugin Library link: /contributing/submit-to-plugin-library/ - title: Pixabay Image Source Plugin Tutorial - link: /docs/tutorial/pixabay-source-plugin-tutorial.md + link: /docs/tutorial/pixabay-source-plugin-tutorial/ - title: Remark Plugin Tutorial - link: docs/tutorial/remark-plugin-tutorial.md + link: docs/tutorial/remark-plugin-tutorial/ - title: Maintaining a Plugin link: /docs/maintaining-a-plugin/ - title: Themes diff --git a/www/src/data/sidebars/tutorial-links.yaml b/www/src/data/sidebars/tutorial-links.yaml index cedb81fd1874c..36b011ed0e607 100644 --- a/www/src/data/sidebars/tutorial-links.yaml +++ b/www/src/data/sidebars/tutorial-links.yaml @@ -110,7 +110,7 @@ link: /tutorial/part-eight/#add-page-metadata - title: Keep making it better link: /tutorial/part-eight/#keep-making-it-better - - title: Theme Tutorials + - title: Plugin & Theme Tutorials link: /tutorial/plugin-and-theme-tutorials/ items: - title: Using a Theme From e94d966bd5ce803d124779cc898812009d55a920 Mon Sep 17 00:00:00 2001 From: Ekwuno Obinna Date: Mon, 2 Mar 2020 23:39:14 +0100 Subject: [PATCH 3/5] fix indentation --- docs/docs/schema-gql-type.md | 1 - www/src/data/sidebars/tutorial-links.yaml | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/docs/schema-gql-type.md b/docs/docs/schema-gql-type.md index 9367227239fd6..64f67e9d32ccf 100644 --- a/docs/docs/schema-gql-type.md +++ b/docs/docs/schema-gql-type.md @@ -108,7 +108,6 @@ Now we can create a GraphQL Field declaration whose type is `AuthorYaml` (which If not a mapping field, it might instead end in `___NODE`, signifying that its value is an ID that is a foreign key reference to another node in redux. Check out the [Source Plugin Tutorial](/docs/tutorial/pixabay-source-plugin-tutorial/) for how this works from a user point of view. Behind the scenes, the field inference is handled by [inferFromFieldName](https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby/src/schema/infer-graphql-type.js#L204). - This is actually quite similar to the mapping case above. We remove the `___NODE` part of the field name. E.g. `author___NODE` would become `author`. Then, we find our `linkedNode`. I.e given the example value for `author` (which would be an ID), we find its actual node in redux. Then, we find its type in processed types by its `internal.type`. Note, that also like in mapping fields, we can define the `linkedField` too. This can be specified via `nodeFieldname___NODE___linkedFieldName`. E.g. for `author___NODE___name`, the linkedField would be `name` instead of `id`. Now we can return a new GraphQL Field object, whose type is the one found above. Its resolver searches through all redux nodes until it finds one with the matching ID. As usual, it also creates a [page dependency](/docs/page-node-dependencies/), from the query context's path to the node ID. diff --git a/www/src/data/sidebars/tutorial-links.yaml b/www/src/data/sidebars/tutorial-links.yaml index 36b011ed0e607..917b5e90f5ddb 100644 --- a/www/src/data/sidebars/tutorial-links.yaml +++ b/www/src/data/sidebars/tutorial-links.yaml @@ -110,7 +110,7 @@ link: /tutorial/part-eight/#add-page-metadata - title: Keep making it better link: /tutorial/part-eight/#keep-making-it-better - - title: Plugin & Theme Tutorials + - title: Plugin & Theme Tutorials link: /tutorial/plugin-and-theme-tutorials/ items: - title: Using a Theme From f433426f72982fde7ea1ba0670615f009fc2cb94 Mon Sep 17 00:00:00 2001 From: Ekwuno Obinna Date: Mon, 9 Mar 2020 17:47:40 +0100 Subject: [PATCH 4/5] Update PR by removing /doc when not needed --- docs/contributing/docs-contributions.md | 2 +- docs/docs/gatsby-vendor-partnership.md | 2 +- docs/docs/naming-a-plugin.md | 2 +- docs/docs/recipes/sourcing-data.md | 2 +- docs/docs/schema-gql-type.md | 2 +- docs/docs/sourcing-from-private-apis.md | 2 +- examples/using-local-plugins/README.md | 2 +- packages/gatsby-cli/src/create-cli.js | 2 +- www/redirects.yaml | 4 ++-- www/src/data/sidebars/doc-links.yaml | 4 ++-- 10 files changed, 12 insertions(+), 12 deletions(-) diff --git a/docs/contributing/docs-contributions.md b/docs/contributing/docs-contributions.md index 5c105281738de..74b472c173d10 100644 --- a/docs/contributing/docs-contributions.md +++ b/docs/contributing/docs-contributions.md @@ -190,7 +190,7 @@ Sometimes it makes sense to move or rename a file as part of docs restructuring ```yaml:title=www/redirects.yaml - fromPath: /docs/source-plugin-tutorial/ - toPath: /docs/tutorial/pixabay-source-plugin-tutorial/ + toPath: /tutorial/pixabay-source-plugin-tutorial/ ``` ## Claim your swag diff --git a/docs/docs/gatsby-vendor-partnership.md b/docs/docs/gatsby-vendor-partnership.md index 069bfa4eb8712..c500b2ab661e4 100644 --- a/docs/docs/gatsby-vendor-partnership.md +++ b/docs/docs/gatsby-vendor-partnership.md @@ -54,7 +54,7 @@ Current partners have reported development timelines of 2-3 days when the conten If you have a GraphQL-based API, you **may not need to build an integration at all** -- Gatsby supports integration with GraphQL APIs via so-called ["schema stitching"](/blog/2018-09-25-announcing-graphql-stitching-support/). -If you have questions while building your Gatsby integrations, try reading other supporting documentation such as the [general plugin authoring guide](/docs/creating-plugins/) and [source plugin tutorial](/docs/tutorial/pixabay-source-plugin-tutorial/). +If you have questions while building your Gatsby integrations, try reading other supporting documentation such as the [general plugin authoring guide](/docs/creating-plugins/) and [source plugin tutorial](/tutorial/pixabay-source-plugin-tutorial/). If you still have questions, please [raise an issue on GitHub](https://github.com/gatsbyjs/gatsby/issues), ask a question in [Discord chat](https://gatsby.dev/discord), or reach out to our team at [developer-relations@gatsbyjs.com](mailto:developer-relations@gatsbyjs.com). diff --git a/docs/docs/naming-a-plugin.md b/docs/docs/naming-a-plugin.md index fbc2e02b4bce5..5e2ca82c4e638 100644 --- a/docs/docs/naming-a-plugin.md +++ b/docs/docs/naming-a-plugin.md @@ -14,7 +14,7 @@ There are five standard plugin naming conventions for Gatsby: - Docs: [creating a transformer plugin](/docs/creating-a-transformer-plugin/) - **`gatsby-[plugin-name]-*`** β€” if a plugin is a plugin for another plugin πŸ˜…, it should be prefixed with the name of the plugin it extends (e.g. if it adds emoji to the output of `gatsby-transformer-remark`, call it `gatsby-remark-add-emoji`). Use this naming convention whenever your plugin will be included as a plugin in the `options` object of another plugin. - Example: [`gatsby-remark-images`](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-remark-images) - - Docs: [creating a remark plugin](docs/tutorial/remark-plugin-tutorial/) + - Docs: [creating a remark plugin](/tutorial/remark-plugin-tutorial/) - **`gatsby-theme-*`** β€” this naming convention is used for [Gatsby themes](/docs/themes/), which are a type of plugin. This naming convention is used for plugins that own a section, a page, or part of a page on a site or expose files and components for [shadowing](/docs/themes/shadowing/). - Example: [`gatsby-theme-blog`](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-theme-blog) - Docs: [creating a theme](/tutorial/building-a-theme/) diff --git a/docs/docs/recipes/sourcing-data.md b/docs/docs/recipes/sourcing-data.md index 174b786fcc15b..264c40b1fdbcd 100644 --- a/docs/docs/recipes/sourcing-data.md +++ b/docs/docs/recipes/sourcing-data.md @@ -59,7 +59,7 @@ query MyPokemonQuery { - Walk through an example using the `gatsby-source-filesystem` plugin in [tutorial part five](/tutorial/part-five/#source-plugins) - Search available source plugins in the [Gatsby library](/plugins/?=source) -- Understand source plugins by building one in the [Pixabay source plugin tutorial](/docs/tutorial/pixabay-source-plugin-tutorial/) +- Understand source plugins by building one in the [Pixabay source plugin tutorial](/tutorial/pixabay-source-plugin-tutorial/) - The createNode function [documentation](/docs/actions/#createNode) ## Sourcing Markdown data for blog posts and pages with GraphQL diff --git a/docs/docs/schema-gql-type.md b/docs/docs/schema-gql-type.md index 64f67e9d32ccf..6b58f9de9560c 100644 --- a/docs/docs/schema-gql-type.md +++ b/docs/docs/schema-gql-type.md @@ -106,7 +106,7 @@ Now we can create a GraphQL Field declaration whose type is `AuthorYaml` (which #### Foreign Key reference (`___NODE`) -If not a mapping field, it might instead end in `___NODE`, signifying that its value is an ID that is a foreign key reference to another node in redux. Check out the [Source Plugin Tutorial](/docs/tutorial/pixabay-source-plugin-tutorial/) for how this works from a user point of view. Behind the scenes, the field inference is handled by [inferFromFieldName](https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby/src/schema/infer-graphql-type.js#L204). +If not a mapping field, it might instead end in `___NODE`, signifying that its value is an ID that is a foreign key reference to another node in redux. Check out the [Source Plugin Tutorial](/tutorial/pixabay-source-plugin-tutorial/) for how this works from a user point of view. Behind the scenes, the field inference is handled by [inferFromFieldName](https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby/src/schema/infer-graphql-type.js#L204). This is actually quite similar to the mapping case above. We remove the `___NODE` part of the field name. E.g. `author___NODE` would become `author`. Then, we find our `linkedNode`. I.e given the example value for `author` (which would be an ID), we find its actual node in redux. Then, we find its type in processed types by its `internal.type`. Note, that also like in mapping fields, we can define the `linkedField` too. This can be specified via `nodeFieldname___NODE___linkedFieldName`. E.g. for `author___NODE___name`, the linkedField would be `name` instead of `id`. diff --git a/docs/docs/sourcing-from-private-apis.md b/docs/docs/sourcing-from-private-apis.md index e4d7732f7451e..3c2e4de53f060 100644 --- a/docs/docs/sourcing-from-private-apis.md +++ b/docs/docs/sourcing-from-private-apis.md @@ -10,7 +10,7 @@ There are 3 approaches that you can use to source data from your private API: 1. If your private API is a GraphQL API, you can use [`gatsby-source-graphql`](/packages/gatsby-source-graphql/). 2. If your private API is not a GraphQL API and you are new to GraphQL, treat the data as unstructured data and fetch it during build time, as described by the guide "[Using Gatsby without GraphQL](/docs/using-gatsby-without-graphql/)". However, as highlighted in the guide, this approach comes with some tradeoffs. -3. Create a source plugin, as described in the tutorial "[Source plugin tutorial](/docs/tutorial/pixabay-source-plugin-tutorial/)". +3. Create a source plugin, as described in the tutorial "[Source plugin tutorial](/tutorial/pixabay-source-plugin-tutorial/)". ## Other considerations diff --git a/examples/using-local-plugins/README.md b/examples/using-local-plugins/README.md index 61aa15ed1d2d1..08b2ff48800fc 100755 --- a/examples/using-local-plugins/README.md +++ b/examples/using-local-plugins/README.md @@ -2,7 +2,7 @@ This example demonstrates usage of a local plugin -- in this case a source plugin. -You might also be interested in the docs section on [local plugins](/docs/creating-a-local-plugin/), or the [source plugin tutorial](/docs/tutorial/pixabay-source-plugin-tutorial/). +You might also be interested in the docs section on [local plugins](/docs/creating-a-local-plugin/), or the [source plugin tutorial](/tutorial/pixabay-source-plugin-tutorial/). ## Using Gatsby's GraphQL integration layer diff --git a/packages/gatsby-cli/src/create-cli.js b/packages/gatsby-cli/src/create-cli.js index 007740b7bd668..5b9b3c73d3cda 100644 --- a/packages/gatsby-cli/src/create-cli.js +++ b/packages/gatsby-cli/src/create-cli.js @@ -386,7 +386,7 @@ Creating a plugin: - Creating a Source Plugin (https://www.gatsbyjs.org/docs/creating-a-source-plugin/) - Creating a Transformer Plugin (https://www.gatsbyjs.org/docs/creating-a-transformer-plugin/) - Submit to Plugin Library (https://www.gatsbyjs.org/contributing/submit-to-plugin-library/) -- Pixabay Source Plugin Tutorial (https://www.gatsbyjs.org/docs/tutorial/pixabay-source-plugin-tutorial/) +- Pixabay Source Plugin Tutorial (https://www.gatsbyjs.org/tutorial/pixabay-source-plugin-tutorial/) - Maintaining a Plugin (https://www.gatsbyjs.org/docs/maintaining-a-plugin/) - Join Discord #plugin-authoring channel to ask questions! (https://gatsby.dev/discord/) `) diff --git a/www/redirects.yaml b/www/redirects.yaml index 81f6cb348268c..7ef1367f29d19 100644 --- a/www/redirects.yaml +++ b/www/redirects.yaml @@ -79,9 +79,9 @@ - fromPath: /tutorial/theme-tutorials toPath: /tutorial/plugin-and-theme-tutorials - fromPath: docs/remark-plugin-tutorial.md - toPath: docs/tutorial/remark-plugin-tutorial.md + toPath: /tutorial/remark-plugin-tutorial/ - fromPath: /docs/source-plugin-tutorial/ - toPath: /docs/tutorial/pixabay-source-plugin-tutorial/ + toPath: /tutorial/pixabay-source-plugin-tutorial/ - fromPath: /docs/how-plugins-work/ toPath: /docs/plugins/ - fromPath: /blog/2018-2-16-how-to-build-a-website-with-react/ diff --git a/www/src/data/sidebars/doc-links.yaml b/www/src/data/sidebars/doc-links.yaml index 0bced80c6fde4..794bd5a439f88 100644 --- a/www/src/data/sidebars/doc-links.yaml +++ b/www/src/data/sidebars/doc-links.yaml @@ -264,9 +264,9 @@ - title: Submit to Plugin Library link: /contributing/submit-to-plugin-library/ - title: Pixabay Image Source Plugin Tutorial - link: /docs/tutorial/pixabay-source-plugin-tutorial/ + link: /tutorial/pixabay-source-plugin-tutorial/ - title: Remark Plugin Tutorial - link: docs/tutorial/remark-plugin-tutorial/ + link: /tutorial/remark-plugin-tutorial/ - title: Maintaining a Plugin link: /docs/maintaining-a-plugin/ - title: Themes From d224a2b633d5f9cd7a75c4cebd401509c0fcd83c Mon Sep 17 00:00:00 2001 From: LB Date: Mon, 9 Mar 2020 11:39:41 -0700 Subject: [PATCH 5/5] Update docs/tutorial/theme-tutorials.md --- docs/tutorial/theme-tutorials.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/tutorial/theme-tutorials.md b/docs/tutorial/theme-tutorials.md index 8a72ca50dd404..6bb9680bf0e8d 100644 --- a/docs/tutorial/theme-tutorials.md +++ b/docs/tutorial/theme-tutorials.md @@ -1,5 +1,5 @@ --- -title: Plugin & Theme Tutorials +title: Plugin & Theme Tutorials --- Gatsby plugins are Node.js packages that implement Gatsby APIs and are commonly installed through a registry like npm. Plugins are a way to encapsulate, re-use, and compose Gatsby functionality. A good example of this concept are Gatsby themes which is a type of plugin that includes a `gatsby-config.js` file and adds pre-configured functionality, data sourcing, and/or UI code to Gatsby sites.