Skip to content

Commit

Permalink
Merge pull request #18682 from storybookjs/seo-page-2
Browse files Browse the repository at this point in the history
docs: Update SEO documentation for `7.0` features
  • Loading branch information
jonniebigodes committed Jul 11, 2022
2 parents 3a8d6e2 + 397c02e commit ad1b593
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
18 changes: 14 additions & 4 deletions docs/sharing/publish-storybook.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,20 @@ Examples: [Netlify](https://www.netlify.com/), [S3](https://aws.amazon.com/en/s3

If your Storybook is publically viewable, you may wish to configure how it is represented in search engine result pages.

### Title

Storybook will generate the document title (i.e. `<title>`) for you automatically, to include the currently-viewed component and story. By default, it looks something like "Components / Button - Primary ⋅ Storybook". You can modify the "Storybook" portion by adding the following to the `main.js` file in your config directory:

<!-- prettier-ignore-start -->

<CodeSnippets
paths={[
'common/seo-title.js.mdx',
]}
/>

<!-- prettier-ignore-end -->

### Description

You can provide a description for search engines to display in the results listing, by adding the following to the `manager-head.html` file in your config directory:
Expand All @@ -161,10 +175,6 @@ You can provide a description for search engines to display in the results listi

<!-- prettier-ignore-end -->

<div class="aside">
💡 You cannot also define <code>&lt;title></code> in this file, because Storybook generates the document title for you to include information about the currently-viewed component and story.
</div>

### Preventing your Storybook from being crawled

You can prevent your published Storybook from appearing in search engine results by including a noindex meta tag, which you can do by adding the following to the `manager-head.html` file in your config directory:
Expand Down
5 changes: 5 additions & 0 deletions docs/snippets/common/seo-title.js.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
```js
// .storybook/main.js

export const title = 'My awesome project';
```

0 comments on commit ad1b593

Please sign in to comment.