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

docs: mention that SEO through front matter is better than head tag #6112

Merged
merged 1 commit into from
Dec 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ Open your browser DevTools and check how this page's metadata have been affected

:::

:::tip

**You don't always need this for typical SEO needs.** Content plugins (e.g. docs and blog) provide front matter options like `description`, `keywords`, and `image`, which will be automatically applied to both `description` and `og:description`, while you would have to manually declare two metadata tags when using the `<head>` tag.

:::

:::note

This feature is built on top of the Docusaurus [`<Head>`](./../../docusaurus-core.md#head) component.
Expand Down
6 changes: 6 additions & 0 deletions website/docs/seo.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@ keywords: [keywords, describing, the main topics]

When creating your React page, adding these fields in `Layout` would also improve SEO.

:::tip

Prefer to use front matter for fields like `description` and `keywords`: Docusaurus will automatically apply this to both `description` and `og:description`, while you would have to manually declare two metadata tags when using the `<head>` tag.

:::

## Static HTML generation {#static-html-generation}

Docusaurus is a static site generator—HTML files are statically generated for every URL route, which helps search engines discover your content more easily.
Expand Down