Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(sync) Sync with gatsby-i18n-source @ 90932a0 #37

Merged
merged 101 commits into from
Feb 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
101 commits
Select commit Hold shift + click to select a range
65d4301
sync with monorepo gatsbyjs/gatsby@2a1508e3175082ec559a5405ba464bf3c9…
ViCo0TeCH Jan 22, 2020
c3cc76b
sync with monorepo gatsbyjs/gatsby@0a066b9227071c696bc4ec1db32358b7af…
ViCo0TeCH Jan 22, 2020
71e12d0
sync with monorepo gatsbyjs/gatsby@930cd31b5c4bcf2b93c3297688a47c903f…
ViCo0TeCH Jan 22, 2020
0d19d38
sync with monorepo gatsbyjs/gatsby@3880394feccacc3e5503f02c7c5b3a3b78…
ViCo0TeCH Jan 23, 2020
4968ece
sync with monorepo gatsbyjs/gatsby@119c345bd4cb8f45649fe547bdfcbdf38a…
ViCo0TeCH Jan 23, 2020
15e5ec7
sync with monorepo gatsbyjs/gatsby@631a3aeb4d1760ccc3df1cde2097fe36b5…
ViCo0TeCH Jan 23, 2020
f61463a
sync with monorepo gatsbyjs/gatsby@d5f6bebe56fa74b3a33be77a35d0e9e9c1…
ViCo0TeCH Jan 23, 2020
e7860d0
sync with monorepo gatsbyjs/gatsby@6c7b2160e5a81bedc4d5418cbf72e1f4f2…
ViCo0TeCH Jan 24, 2020
af30972
sync with monorepo gatsbyjs/gatsby@e77f39c0f53ec571184c189521b0437a85…
ViCo0TeCH Jan 24, 2020
7951416
sync with monorepo gatsbyjs/gatsby@8d521b25496ddd38700939ef85d5bf3283…
ViCo0TeCH Jan 24, 2020
2f756f7
sync with monorepo gatsbyjs/gatsby@106e74f4a4f1424aa0e32663c14cea6c74…
ViCo0TeCH Jan 24, 2020
33261b0
sync with monorepo gatsbyjs/gatsby@232de9bb554af3101ef64eb549054d48f3…
ViCo0TeCH Jan 25, 2020
887dd5b
sync with monorepo gatsbyjs/gatsby@fe40bcead7200f0c9eed122c7affb76fe4…
ViCo0TeCH Jan 25, 2020
1ca4bab
sync with monorepo gatsbyjs/gatsby@342444bd0aa34dc9433116d7f57c46949d…
ViCo0TeCH Jan 25, 2020
288884b
sync with monorepo gatsbyjs/gatsby@eb2348cfb585492c632ac5c91bdc86a472…
ViCo0TeCH Jan 25, 2020
d663c45
sync with monorepo gatsbyjs/gatsby@8561d104f81e7037761e247b7e7a53df01…
ViCo0TeCH Jan 26, 2020
e31fff8
sync with monorepo gatsbyjs/gatsby@ea65aea62fd9a74f107440911b9fe9e430…
ViCo0TeCH Jan 27, 2020
5a41510
sync with monorepo gatsbyjs/gatsby@1417195c0e618cfbd832d9bd286ba1faa1…
ViCo0TeCH Jan 27, 2020
471c8b9
sync with monorepo gatsbyjs/gatsby@c8a0240fbd53a43e030454f583a5165ab5…
ViCo0TeCH Jan 27, 2020
2ac3637
sync with monorepo gatsbyjs/gatsby@6618f02b7eb3378173c040989f769930be…
ViCo0TeCH Jan 27, 2020
650d085
sync with monorepo gatsbyjs/gatsby@7c604e02afde37472342650c99122ab6dd…
ViCo0TeCH Jan 27, 2020
52cf779
sync with monorepo gatsbyjs/gatsby@094ca4cfa5fc5f973e953eaae389122a2d…
ViCo0TeCH Jan 28, 2020
7a7d17d
sync with monorepo gatsbyjs/gatsby@8d204404df2cf82ed19d65ce99430c325f…
ViCo0TeCH Jan 28, 2020
e477aa4
sync with monorepo gatsbyjs/gatsby@4ad2a241e4f5a24490838a397c70de5e41…
ViCo0TeCH Jan 29, 2020
102617d
sync with monorepo gatsbyjs/gatsby@f062e6e45a34110e30aa3bea775d063c25…
ViCo0TeCH Jan 29, 2020
ae2f3d4
sync with monorepo gatsbyjs/gatsby@8bce690c1f69f56391a8009515e41c20af…
ViCo0TeCH Jan 29, 2020
806f02d
sync with monorepo gatsbyjs/gatsby@91bb25a15cd684d910bbf2575aae9f2a6f…
ViCo0TeCH Jan 30, 2020
b45c769
sync with monorepo gatsbyjs/gatsby@ef59c5d56a7b2561ce66a51e7094711ea6…
ViCo0TeCH Jan 30, 2020
5b8fce8
sync with monorepo gatsbyjs/gatsby@98cf04200829e8157dd910ffe3fcbd8f1f…
ViCo0TeCH Jan 30, 2020
cd2f0ce
sync with monorepo gatsbyjs/gatsby@ae6d47471b8e39ecb7e1a2a6d5644c052a…
ViCo0TeCH Jan 30, 2020
e3afa26
sync with monorepo gatsbyjs/gatsby@adfb8671d49d7be144813b22579a40f75e…
ViCo0TeCH Jan 30, 2020
de3677b
sync with monorepo gatsbyjs/gatsby@1320250da59b6ff325929371daef7fc07f…
ViCo0TeCH Jan 30, 2020
a2bcf60
sync with monorepo gatsbyjs/gatsby@cfcf0f2c8da7f778c54abd15bc40a2a1d6…
ViCo0TeCH Jan 30, 2020
7d864a6
sync with monorepo gatsbyjs/gatsby@fad926e49ef878b478c85608a7c63f7338…
ViCo0TeCH Jan 30, 2020
56f44fc
sync with monorepo gatsbyjs/gatsby@7edd54fba33fe35abc8b2b94826df9ea45…
ViCo0TeCH Jan 30, 2020
bd9294e
sync with monorepo gatsbyjs/gatsby@547edd7a5c5cdaf0f18349b94b33f7f19c…
ViCo0TeCH Jan 30, 2020
801001c
sync with monorepo gatsbyjs/gatsby@cfe936362f37222fcce63c7c39ecce673c…
ViCo0TeCH Jan 30, 2020
b0b59b9
sync with monorepo gatsbyjs/gatsby@e935e0fc78974a749bccf37399ea766892…
ViCo0TeCH Jan 31, 2020
51b6e51
sync with monorepo gatsbyjs/gatsby@21742cfd4d1f1d0def9a67ac1a127402f1…
ViCo0TeCH Jan 31, 2020
e8f42cc
sync with monorepo gatsbyjs/gatsby@412eba61cd8fd23069cdb560f994e7dfdf…
ViCo0TeCH Jan 31, 2020
a192704
sync with monorepo gatsbyjs/gatsby@65d36d8e0d6525415810c732be0d842822…
ViCo0TeCH Jan 31, 2020
55e5b22
sync with monorepo gatsbyjs/gatsby@4efb1482398c9505a6975c15db6643898e…
ViCo0TeCH Feb 1, 2020
03a7ab3
sync with monorepo gatsbyjs/gatsby@74a6028db95a56f9d15ba2d582be396ea1…
ViCo0TeCH Feb 1, 2020
3a1261a
sync with monorepo gatsbyjs/gatsby@3387b2b863da048ba0d0d3ee6510e25fbb…
ViCo0TeCH Feb 1, 2020
378e514
sync with monorepo gatsbyjs/gatsby@55f99d14e4985bf7a00d2bdc7971739606…
ViCo0TeCH Feb 1, 2020
6fb0b31
sync with monorepo gatsbyjs/gatsby@d8937d042edd229657289fce164d4e7815…
ViCo0TeCH Feb 1, 2020
0cf7730
sync with monorepo gatsbyjs/gatsby@de1109f1733b915b6cd6e3479eec88c12f…
ViCo0TeCH Feb 3, 2020
9df3cf4
sync with monorepo gatsbyjs/gatsby@6711386eca5bd00ea0c5187f939893f277…
ViCo0TeCH Feb 3, 2020
3936965
sync with monorepo gatsbyjs/gatsby@eba30974c7944cfecb47c1c63bb0ddc515…
ViCo0TeCH Feb 4, 2020
b400111
sync with monorepo gatsbyjs/gatsby@b52cec76ab764257eac366d020ace30152…
ViCo0TeCH Feb 6, 2020
a3bb598
sync with monorepo gatsbyjs/gatsby@9eec22b4f1bb5ec0d5334ea17c82635c41…
ViCo0TeCH Feb 6, 2020
5fe523e
sync with monorepo gatsbyjs/gatsby@23e575bd0d18d2ebf02364c892b27aba26…
ViCo0TeCH Feb 7, 2020
483b92a
sync with monorepo gatsbyjs/gatsby@43b2eb8e81f64cfca7c4660708aaffcee6…
ViCo0TeCH Feb 8, 2020
4dbbc6e
sync with monorepo gatsbyjs/gatsby@52f7de27c25fad5b029f371b07666fd9eb…
ViCo0TeCH Feb 9, 2020
382096e
sync with monorepo gatsbyjs/gatsby@ef51179d64e17b296e2641346f6d4f2ee0…
ViCo0TeCH Feb 9, 2020
da67edd
sync with monorepo gatsbyjs/gatsby@9f5677128b53c5bff2efd75baeff8b6db4…
ViCo0TeCH Feb 9, 2020
c02f930
sync with monorepo gatsbyjs/gatsby@566085a69a13b65c39d5433935fece34d1…
ViCo0TeCH Feb 9, 2020
139bfa1
sync with monorepo gatsbyjs/gatsby@c9b0fa3fceab7ec3dd4b4d1be762fd8c47…
ViCo0TeCH Feb 9, 2020
932d232
sync with monorepo gatsbyjs/gatsby@cb6434161b37b60ca878d059512d4e32f1…
ViCo0TeCH Feb 9, 2020
e49643c
sync with monorepo gatsbyjs/gatsby@c3380bc992ea1ac4eac45681fa4785f2b8…
ViCo0TeCH Feb 10, 2020
e20dde4
sync with monorepo gatsbyjs/gatsby@05a95edd16fb768341e6461ad544b8c8f0…
ViCo0TeCH Feb 10, 2020
5d04115
sync with monorepo gatsbyjs/gatsby@df5729e3e704c746bb2b087a9944de006b…
ViCo0TeCH Feb 10, 2020
bae97bf
sync with monorepo gatsbyjs/gatsby@83bece953a6371f36f1ecf0b54d6d47248…
ViCo0TeCH Feb 10, 2020
5757439
sync with monorepo gatsbyjs/gatsby@c90501426c25b68965c466dd6ee2e7eafd…
ViCo0TeCH Feb 10, 2020
202a512
sync with monorepo gatsbyjs/gatsby@31d9a2cedad14a79ea3dd5a462a8fa02ec…
ViCo0TeCH Feb 10, 2020
c516840
sync with monorepo gatsbyjs/gatsby@2af31f39f5b41fc06bd3055da9ee03ffdb…
ViCo0TeCH Feb 11, 2020
0cc19ae
sync with monorepo gatsbyjs/gatsby@5d09434db1fb7382d5c9332338ac42d2d6…
ViCo0TeCH Feb 11, 2020
87dd506
sync with monorepo gatsbyjs/gatsby@ef72f2b23190eae8ee5aa63ca3ff9ed8a4…
ViCo0TeCH Feb 11, 2020
8a42750
sync with monorepo gatsbyjs/gatsby@f99d968d4914837d9b063bb19bf7fbe46e…
ViCo0TeCH Feb 11, 2020
fd3df38
sync with monorepo gatsbyjs/gatsby@c2fe59f3bd0f198255f19de120fe9ae3fd…
ViCo0TeCH Feb 11, 2020
cb398fd
sync with monorepo gatsbyjs/gatsby@26397728fa67568d892330df014d18501f…
ViCo0TeCH Feb 12, 2020
82c511e
sync with monorepo gatsbyjs/gatsby@4752f53d49c5bef98ec320da44ebb800e8…
ViCo0TeCH Feb 12, 2020
5317e08
sync with monorepo gatsbyjs/gatsby@e787843a9a58e4665c7665bdb0040681bf…
ViCo0TeCH Feb 12, 2020
79b09bc
sync with monorepo gatsbyjs/gatsby@c32a4105e1dab2d6b92615a7b6cab5f634…
ViCo0TeCH Feb 12, 2020
f9d2d2c
sync with monorepo gatsbyjs/gatsby@f4b408577fb6a3e67c8e09adb99eeccbeb…
ViCo0TeCH Feb 12, 2020
7f6ac9f
sync with monorepo gatsbyjs/gatsby@d9391442a81172ccb6eb33d0595b464446…
ViCo0TeCH Feb 12, 2020
ec07bba
sync with monorepo gatsbyjs/gatsby@b7ddd643aef38899ac9fe1fa4f1cda7cbc…
ViCo0TeCH Feb 13, 2020
13b06d0
sync with monorepo gatsbyjs/gatsby@0d4de52d630347cfa19717034be5f09822…
ViCo0TeCH Feb 13, 2020
8a4af61
sync with monorepo gatsbyjs/gatsby@c156da782435cc54717ad3eed7734222d2…
ViCo0TeCH Feb 13, 2020
c8f2267
sync with monorepo gatsbyjs/gatsby@de58ef1ec9178658f38bbd4d521c2d964f…
ViCo0TeCH Feb 13, 2020
4c33fac
sync with monorepo gatsbyjs/gatsby@82037f9b3a46831d7386162ee05aa3e3f7…
ViCo0TeCH Feb 14, 2020
db95c4b
sync with monorepo gatsbyjs/gatsby@7c06ec7f98f6eedab970010bd995d787eb…
ViCo0TeCH Feb 14, 2020
42fc0a2
sync with monorepo gatsbyjs/gatsby@e90fcc2871a8a5ee7e904684aff1de8670…
ViCo0TeCH Feb 14, 2020
65402c8
sync with monorepo gatsbyjs/gatsby@8fd5877ed74d89d17633ea380222d8b9d7…
ViCo0TeCH Feb 15, 2020
b61ebc4
sync with monorepo gatsbyjs/gatsby@751a834ef85a64d6e14dcb95d4093da7fb…
ViCo0TeCH Feb 17, 2020
d2f6857
sync with monorepo gatsbyjs/gatsby@11bd2b5cdbc08f67941e69abbcb8d6d20e…
ViCo0TeCH Feb 18, 2020
869ff67
sync with monorepo gatsbyjs/gatsby@bcb99974fd5089561d40062a209e41d198…
ViCo0TeCH Feb 18, 2020
9f41f1f
sync with monorepo gatsbyjs/gatsby@a09d2f5b78ce0f6f54da13f364b353a35c…
ViCo0TeCH Feb 18, 2020
a2d09b8
sync with monorepo gatsbyjs/gatsby@138669710db7d992befd40d8bc5f0d7752…
ViCo0TeCH Feb 18, 2020
35d038e
sync with monorepo gatsbyjs/gatsby@9ea045351ec1dc80967d13a6bfd9c57095…
ViCo0TeCH Feb 18, 2020
c6359d2
sync with monorepo gatsbyjs/gatsby@cc99ac612348c992a91ae5a70c8c212061…
ViCo0TeCH Feb 18, 2020
6d73d67
sync with monorepo gatsbyjs/gatsby@b9837ae2f460d71d1fc2895dc06dc537b1…
ViCo0TeCH Feb 18, 2020
9ca5e8c
sync with monorepo gatsbyjs/gatsby@dc6474e4c972f63b139b3df66e8ca54357…
ViCo0TeCH Feb 18, 2020
d6d0656
sync with monorepo gatsbyjs/gatsby@f5acf522feb48ad211e509a788e870effd…
ViCo0TeCH Feb 18, 2020
2946bb1
sync with monorepo gatsbyjs/gatsby@9884cd8bbc23281fd7927f9dba6ff52629…
ViCo0TeCH Feb 18, 2020
b87f4f9
sync with monorepo gatsbyjs/gatsby@c5533fad7b8cf3752c71812c88b27f2a55…
ViCo0TeCH Feb 18, 2020
19911e3
sync with monorepo gatsbyjs/gatsby@f0cc2dcb699356972bf3ca0bedc1dbaa8f…
ViCo0TeCH Feb 18, 2020
22a3fb4
sync with monorepo gatsbyjs/gatsby@a6b5ed4ea3e131748caa2b2e1315da7db2…
ViCo0TeCH Feb 18, 2020
97b6c42
sync with monorepo gatsbyjs/gatsby@9b2d51b50fc2187138bf2ab3c94571db6f…
ViCo0TeCH Feb 19, 2020
90932a0
sync with monorepo gatsbyjs/gatsby@8234336d31e695ef6985c6e17bf997cb86…
ViCo0TeCH Feb 19, 2020
3142db7
Merge branch 'master' of https://github.com/gatsbyjs/gatsby-i18n-sour…
tesseralis Feb 19, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
179 changes: 1 addition & 178 deletions docs/contributing/docs-and-website-components.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,6 @@ title: Docs and Website Components
tableOfContentsDepth: 2
---

import LayerModel from "../../www/src/components/layer-model"
import HorizontalNavList from "../../www/src/components/horizontal-nav-list"
import Breadcrumb from "../../www/src/components/docs-breadcrumb"
import { itemListContributing } from "../../www/src/utils/sidebar/item-list"
import TableOfContents from "../../www/src/components/docs-table-of-contents"

The Gatsbyjs.org site has a handful of components that have been developed to facilitate writing new content for the blog and the docs. There are also components that help organize and lay out content in various pages across the website.

This guide documents what components are available and explains how to use them. You can also refer to the [code for this page on GitHub](https://github.com/gatsbyjs/gatsby/blob/master/docs/contributing/docs-and-website-components.md) to see to how each component can be used, because they are all embedded here!
Expand Down Expand Up @@ -130,14 +124,6 @@ Rendered, the component looks like this:
To improve is to change, so to be perfect is to have changed often.
</Pullquote>

---

## Other available components

Other less commonly used components aren't globally available, but can imported at the top of a Markdown file and used in other docs.

---

### Layer Model

The `<LayerModel />` was made to help explain concepts of how Gatsby works at a high level. It conceptually breaks Gatsby into different layers and shows how data is pulled, aggregated, and eventually rendered as an app. It's used on docs pages to help explain how Gatsby works at different levels.
Expand Down Expand Up @@ -168,7 +154,7 @@ When used, it looks like this:

### Horizontal Navigation List

The `<HorizontalNavList />` was made for the [Glossary](/docs/glossary/), and renders a list of links to alphabetical subheadings on the page in a horizontal format. Because of its specific use case, it isn't made globally available but can be imported if needed on other pages.
The `<HorizontalNavList />` was made for the [Glossary](/docs/glossary/), and renders a list of links to alphabetical subheadings on the page in a horizontal format.

#### Usage

Expand Down Expand Up @@ -212,169 +198,6 @@ items={[
slug={props.slug}
/>

### Breadcrumb

The `<Breadcrumb />` component is used in layout files to display the hierarchy of pages a user is currently browsing on.

#### Usage

The Breadcrumb component takes one prop:

- `location` - an object provided in the props of page templates by default
- `itemList` - an object comprised of the docs hierarchical structure

<!-- prettier-ignore -->
```jsx
import Breadcrumb from "../../www/src/components/docs-breadcrumb"

<Breadcrumb location={props.location} itemList={itemList} />
```

_You can also refer to [an example of usage of the Breadcrumb in the Gatsbyjs.org source code](https://github.com/gatsbyjs/gatsby/blob/1d65ce051967dda5c4a89da920fc34692524e237/www/src/templates/template-docs-markdown.js#L82)_

#### Optional `breadcrumbTitle` entries in sidebar files

To alter the title of a doc that is displayed in the Breadcrumb component, a `breadcrumbTitle` is supported as a key in the [sidebar YAML files](https://github.com/gatsbyjs/gatsby/tree/master/www/src/data/sidebars). It is commonly used to provide an abbreviated version of a doc's title when displayed next to its parent page title, e.g. shortening "Adding a Custom webpack Config" to "webpack Config".

#### Sample

Rendered, it looks like this:

<Breadcrumb
location={{
pathname: "/contributing/docs-and-website-components/",
}}
itemList={itemListContributing}
/>

---

### Table of Contents

The `<TableOfContents />` component is used to render a list of subheaders from a docs page and automatically provide deep links to them.

#### Usage

The component takes 2 props:

- `location` - an object provided in the props of page templates by default
- `page` - an object with data passed in from the sites `gatsby-node.js` that contains information from the MDX plugin about the structure of headings

<!-- prettier-ignore -->
```jsx
import TableOfContents from "../../www/src/components/docs-table-of-contents"

<TableOfContents location={props.location} page={page} />
```

_You can also refer to [an example of usage of the Table of Contents in the Gatsbyjs.org source code](https://github.com/gatsbyjs/gatsby/blob/1d65ce051967dda5c4a89da920fc34692524e237/www/src/templates/template-docs-markdown.js#L121)_

The Table of Contents component also has some optional configurations that can be set in the frontmatter of a doc's markdown.

In docs where the Table of Contents isn't required and should be disabled, a key in the frontmatter called `disableTableOfContents` can be set to `true` like this:

```markdown
---
title: Glossary
disableTableOfContents: true
---

When you're new to Gatsby there can be a lot of words to learn...
```

In other docs where the Table of Contents is extremely long it can make sense to only show headers from the doc up to a certain level, rather than all subheadings. You can set the `tableOfContentsDepth` key to a number that will limit the subheadings shown in the table of contents to that "depth". If it is set to 2, `<h2>`/`##`, and `<h3>`/`###` headers will be listed, if set to 3, `<h2>`/`##`, `<h3>`/`###`, and `<h4>`/`####` will all be shown. It is set like this:

```markdown
---
title: Glossary
tableOfContentsDepth: 2
---

When you're new to Gatsby there can be a lot of words to learn...
```

#### Sample

The Table of Contents looks like this when rendered (and is also displayed on the right hand side of the page):

<TableOfContents
location={{ pathname: "/contributing/docs-and-website-components/" }}
page={{
frontmatter: {
title: "Docs and Website Components",
tableOfContentsDepth: 2,
},
tableOfContents: {
items: [
{
url: "#globally-available-components",
title: "Globally available components",
items: [
{
url: "#guide-list",
title: "Guide list",
},
{
url: "#egghead-embed",
title: "Egghead embed",
},
{
url: "#pull-quote",
title: "Pull quote",
},
],
},
{
url: "#other-available-components",
title: "Other available components",
items: [
{
url: "#layer-model",
title: "Layer model",
},
{
url: "#horizontal-navigation-list",
title: "Horizontal navigation list",
},
{
url: "#breadcrumb",
title: "Breadcrumb",
},
{
url: "#table-of-contents",
title: "Table of Contents",
},
],
},
{
url: "#writing-content-in-markdown",
title: "Writing content in markdown",
items: [
{
url: "#code-blocks",
title: "Code blocks",
},
],
},
{
url: "#styling-components-on-gatsbyjsorg-with-theme-ui",
title: "Styling components on Gatsbyjs.org with Theme-UI",
items: [
{
url: "#design-tokens",
title: "Design tokens",
},
{
url: "#the-sx-prop",
title: "The sx prop",
},
],
},
],
},
}}
/>

---

## Writing content in Markdown
Expand Down
90 changes: 82 additions & 8 deletions docs/contributing/docs-contributions.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,20 +98,94 @@ It can be necessary to change a heading within the docs. It's important to note
- Determine the URL you're looking for. `Changing headers` is linked with a URL ending in `changing-headers`, `Docs renaming instructions` becomes `docs-renaming-instructions`, etc.
- Update all instances of the old URL to your new one. [Find and replace](https://code.visualstudio.com/docs/editor/codebasics#_search-across-files) in VS Code can help. Check that the context of the original link reference still makes sense with the new one.

## Adding a description

The site automatically creates description tags in order to boost SEO:

```html
<meta name="description" content="Documentation of Gatsby" />
<meta property="og:description" content="Documentation of Gatsby" />
<meta name="twitter:description" content="Documentation of Gatsby" />
```

By default, this description is generated from the `page.excerpt`. If you would like to add a custom description, you can use the `description` frontmatter tag:

```markdown
---
title: Gatsby Community Events
description: Learn about other events happening around the globe to connect with other members of the Gatsby community
---
```

## Configuring site navigation

The docs include custom built components to aid with navigation. In order to customize the navigation experience, these components allow some configurations without changing any of the React code.

### Adjusting breadcrumb titles

The `<Breadcrumb />` component is used in layout files to display the hierarchy of pages a user is currently browsing on at the top of each doc.

To alter the title of a doc that is displayed in the Breadcrumb component, `breadcrumbTitle` is supported as a key in the [sidebar YAML files](https://github.com/gatsbyjs/gatsby/tree/master/www/src/data/sidebars). It is commonly used to provide an abbreviated version of a doc's title when displayed next to its parent page title, e.g. shortening "Adding a Custom webpack Config" to "webpack Config".

```yaml
- title: Adding Page Transitions
link: /docs/adding-page-transitions/
breadcrumbTitle: Page Transitions # highlight-line
```

### Disabling or shortening Table of Contents

The `<TableOfContents />` component is used to render a list of subheaders from a docs page and automatically provide deep links to them. It can be tweaked by values set in the frontmatter of a doc's markdown.

In docs where the Table of Contents isn't required and should be disabled, a key in the frontmatter called `disableTableOfContents` can be set to `true` like this:

```markdown
---
title: Glossary
disableTableOfContents: true
---

When you're new to Gatsby there can be a lot of words to learn...
```

In other docs where the Table of Contents is extremely long it can make sense to only show headers from the doc up to a certain level, rather than all subheadings. You can set the `tableOfContentsDepth` key to a number that will limit the subheadings shown in the table of contents to that "depth". If it is set to 2, `<h2>`/`##`, and `<h3>`/`###` headers will be listed, if set to 3, `<h2>`/`##`, `<h3>`/`###`, and `<h4>`/`####` will all be shown. It is set like this:

```markdown
---
title: Glossary
tableOfContentsDepth: 2
---

When you're new to Gatsby there can be a lot of words to learn...
```

## Adding embedded GraphQL examples

There are embedded examples in a few places in the docs (like the [GraphQL Reference guide](/docs/graphql-reference/)) that provide a working version of the code described. In the specific example of the GraphQL Query Options Reference page, these examples of the GraphiQL interface show how data can be queried from Gatsby's data layer.

To write a new GraphQL example, a Codesandbox project with a Gatsby site can be opened at its server container link, for example: [https://711808k40x.sse.codesandbox.io/](https://711808k40x.sse.codesandbox.io/). Because Codesandbox is running a Gatsby site in [`develop` mode instead of `build` mode](/docs/overview-of-the-gatsby-build-process/) you can navigate to GraphiQL by adding `/___graphql` to the link. Write an example query, and when you have a query you are satisfied with, the query fields and names will be saved as URL parameters so you can share the link. Copy the URL and use it as the `src` of an iframe:

```mdx
Here's an example of a GraphQL query inline:

<iframe src="https://711808k40x.sse.codesandbox.io/___graphql?query=query%20TitleQuery%20%7B%0A%20%20site%20%7B%0A%20%20%20%20siteMetadata%20%7B%0A%20%20%20%20%20%20title%0A%20%20%20%20%7D%0A%20%20%7D%0A%7D%0A&explorerIsOpen=false&operationName=TitleQuery" /> // highlight-line

More markdown content...
```

> Note that you should set the `explorerIsOpen` parameter in the URL to `false` if it isn't already.

## Docs renaming instructions

Sometimes it makes sense to move or rename a file as part of docs restructuring or for content clarification. While we recommend keeping URLs consistent as often as possible, here are some tips to minimize errors and keep the docs in a good state:

- Run proposed structure changes by the Gatsby docs team in [a GitHub issue](/contributing/how-to-file-an-issue/) to ensure your change is accepted.
- Update all instances of the old URL to your new one. [Find and replace](https://code.visualstudio.com/docs/editor/codebasics#_search-across-files) in VS Code can help. Check that the context of the original link reference still makes sense with the new one.
- For SEO purposes, add a redirect to the `createPages` function in [`www/gatsby-node.js`](https://github.com/gatsbyjs/gatsby/tree/master/www/gatsby-node.js). Here's an example:

```js:title=www/gatsby-node.js
createRedirect({
fromPath: `/docs/source-plugin-tutorial/`,
toPath: `/docs/pixabay-source-plugin-tutorial/`,
isPermanent: true,
})
- For SEO purposes, add a redirect to [`www/redirects.yaml`](https://github.com/gatsbyjs/gatsby/tree/master/www/redirects.yaml). Here's an example:

```yaml:title=www/redirects.yaml
- fromPath: /docs/source-plugin-tutorial/
toPath: /docs/pixabay-source-plugin-tutorial/
```

## Claim your swag
Expand Down
9 changes: 7 additions & 2 deletions docs/contributing/docs-templates.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ Here are some things to keep in mind when deciding where to contribute to Gatsby
- [Recipes](#recipes) add concise, discoverable, and easy-to-follow instructions for common Gatsby tasks. They are smaller units than tutorials.
- [Tutorials](#tutorials) should provide step-by-step guidance for Gatsby workflows, listing all pre-requisites and not assuming knowledge or skipping steps.

When writing (or reviewing) learning materials that show Gatsby users how to complete tasks, you are expected to **test out any code examples or steps to ensure they work**. This can also help with writing in your own words, rather than copying from other sources. If you have a demo project or code example that strengthens docs and you don't know where to put it, mention it to the Gatsby Learning team in a PR.

### Why use templates?

Here are templates (models) to follow when contributing to Gatsby docs to ensure that the docs accomplish their purpose. If you have a good reason to deviate from the following template structures, mention those reasons in the PR so others can give proper feedback.
Expand Down Expand Up @@ -198,6 +200,7 @@ A recipe should list requirements and include a few short instructions to comple

The components of a recipe are:

- Overview link on [`recipes.md`](https://github.com/gatsbyjs/gatsby/blob/master/docs/docs/recipes.md)
- The name of the recipe, which should describe a single task
- A 1-2 sentence description motivating what the recipe is for
- Prerequisites and requirements
Expand All @@ -209,8 +212,6 @@ Recipes should be short. This is accomplished by limiting steps to what is uniqu

If you're finding a recipe is becoming too long to fit on the Docs Recipes page due to including many prerequisites or steps, consider writing a tutorial instead.

> Note: If you add a new recipe to the existing sections, be sure to add it to the list on the [`recipes.md` landing page](https://github.com/gatsbyjs/gatsby/blob/master/docs/docs/recipes.md)!

### Recipe categories

Grouping recipes by topic will allow users to navigate and learn by subject matter. As recipes following the new format are introduced, you might find a section needs an h2 heading added for the group. The older-style recipes should be gradually replaced with actionable recipes following the template below.
Expand All @@ -235,6 +236,10 @@ Here's a template for a new recipe category:

### Recipe parts

#### Overview link

To make sure your recipe is linked from the overview page, you must add it to the appropriate category in [`recipes.md`](https://github.com/gatsbyjs/gatsby/blob/master/docs/docs/recipes.md). Otherwise, it will be difficult for Gatsby users to find it, which isn't good for anyone!

#### Title and description

To help motivate the purpose of a recipe, its title should clearly indicate the task being covered; not just the tool or API being used. E.g. "Using the StaticQuery Component" is more descriptive than "StaticQuery".
Expand Down
11 changes: 11 additions & 0 deletions docs/contributing/events.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
title: Gatsby Community Events
description: Learn about other events happening around the globe to connect with other members of the Gatsby community
---

Interested in connecting with the Gatsby community in person? Take a look at the list below to see community-organized Gatsby events.

Want to see your event featured here? [Submit your Gatsby event info!](https://airtable.com/shrpwc99yogJm9sfI)

<Events />
<EmailCaptureForm signupMessage="Want to keep up with the latest tips & tricks? Subscribe to our newsletter!" />
Loading