mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-09 22:32:53 +02:00
misc: replace all "Metadatas" with "Metadata" (#5871)
Co-authored-by: Josh-Cena <sidachen2003@gmail.com>
This commit is contained in:
parent
eab8c7c010
commit
c541e2d83c
36 changed files with 107 additions and 106 deletions
|
@ -246,7 +246,7 @@ Accepted fields:
|
|||
| `title` | `string` | Markdown title or `id` | The text title of your document. Used for the page metadata and as a fallback value in multiple places (sidebar, next/previous buttons...). Automatically added at the top of your doc if it does not contain any Markdown title. |
|
||||
| `pagination_label` | `string` | `sidebar_label` or `title` | The text used in the document next/previous buttons for this document. |
|
||||
| `sidebar_label` | `string` | `title` | The text shown in the document sidebar for this document. |
|
||||
| `sidebar_position` | `number` | Default ordering | Controls the position of a doc inside the generated sidebar slice when using `autogenerated` sidebar items. See also [Autogenerated sidebar metadatas](/docs/sidebar#autogenerated-sidebar-metadatas). |
|
||||
| `sidebar_position` | `number` | Default ordering | Controls the position of a doc inside the generated sidebar slice when using `autogenerated` sidebar items. See also [Autogenerated sidebar metadata](/docs/sidebar#autogenerated-sidebar-metadata). |
|
||||
| `sidebar_class_name` | `string` | `undefined` | Gives the corresponding sidebar label a special class name when using autogenerated sidebars. |
|
||||
| `hide_title` | `boolean` | `false` | Whether to hide the title at the top of the doc. It only hides a title declared through the frontmatter, and have no effect on a Markdown title at the top of your document. |
|
||||
| `hide_table_of_contents` | `boolean` | `false` | Whether to hide the table of contents to the right. |
|
||||
|
|
|
@ -93,9 +93,9 @@ module.exports = {
|
|||
};
|
||||
```
|
||||
|
||||
### Metadatas {#metadatas}
|
||||
### Metadata {#metadata}
|
||||
|
||||
You can configure additional html metadatas (and override existing ones).
|
||||
You can configure additional html metadata (and override existing ones).
|
||||
|
||||
Accepted fields:
|
||||
|
||||
|
@ -103,7 +103,7 @@ Accepted fields:
|
|||
|
||||
| Name | Type | Default | Description |
|
||||
| --- | --- | --- | --- |
|
||||
| `metadatas` | `Metadata[]` | `[]` | Any field will be directly passed to the `<meta />` tag. Possible fields include `id`, `name`, `property`, `content`, `itemprop`, etc. |
|
||||
| `metadata` | `Metadata[]` | `[]` | Any field will be directly passed to the `<meta />` tag. Possible fields include `id`, `name`, `property`, `content`, `itemprop`, etc. |
|
||||
|
||||
</small>
|
||||
|
||||
|
@ -113,7 +113,7 @@ Example configuration:
|
|||
module.exports = {
|
||||
themeConfig: {
|
||||
// highlight-next-line
|
||||
metadatas: [{name: 'twitter:card', content: 'summary'}],
|
||||
metadata: [{name: 'twitter:card', content: 'summary'}],
|
||||
},
|
||||
};
|
||||
```
|
||||
|
|
|
@ -499,11 +499,11 @@ module.exports = {
|
|||
};
|
||||
```
|
||||
|
||||
#### Autogenerated sidebar metadatas {#autogenerated-sidebar-metadatas}
|
||||
#### Autogenerated sidebar metadata {#autogenerated-sidebar-metadata}
|
||||
|
||||
By default, the sidebar slice will be generated in **alphabetical order** (using files and folders names).
|
||||
|
||||
If the generated sidebar does not look good, you can assign additional metadatas to docs and categories.
|
||||
If the generated sidebar does not look good, you can assign additional metadata to docs and categories.
|
||||
|
||||
**For docs**: use additional frontmatter:
|
||||
|
||||
|
@ -566,7 +566,7 @@ By default, Docusaurus will **remove the number prefix** from the doc id, title,
|
|||
|
||||
:::caution
|
||||
|
||||
**Prefer using [additional metadatas](#autogenerated-sidebar-metadatas)**.
|
||||
**Prefer using [additional metadata](#autogenerated-sidebar-metadata)**.
|
||||
|
||||
Updating a number prefix can be annoying, as it can require **updating multiple existing markdown links**:
|
||||
|
||||
|
|
|
@ -1,34 +1,34 @@
|
|||
---
|
||||
id: head-metadatas
|
||||
title: Head Metadatas
|
||||
description: Declaring page-specific head metadatas through MDX
|
||||
slug: /markdown-features/head-metadatas
|
||||
id: head-metadata
|
||||
title: Head Metadata
|
||||
description: Declaring page-specific head metadata through MDX
|
||||
slug: /markdown-features/head-metadata
|
||||
---
|
||||
|
||||
# Head Metadatas
|
||||
# Head Metadata
|
||||
|
||||
Docusaurus automatically sets useful page metadatas in `<html>`, `<head>` and `<body>` for you.
|
||||
Docusaurus automatically sets useful page metadata in `<html>`, `<head>` and `<body>` for you.
|
||||
|
||||
It is possible to add extra metadatas (or override existing ones) by using the `<head>` tag in Markdown files:
|
||||
It is possible to add extra metadata (or override existing ones) by using the `<head>` tag in Markdown files:
|
||||
|
||||
```md title="markdown-features-head-metadatas.mdx"
|
||||
```md title="markdown-features-head-metadata.mdx"
|
||||
---
|
||||
id: head-metadatas
|
||||
title: Head Metadatas
|
||||
id: head-metadata
|
||||
title: Head Metadata
|
||||
---
|
||||
|
||||
<!-- highlight-start -->
|
||||
<head>
|
||||
<html className="some-extra-html-class" />
|
||||
<body className="other-extra-body-class" />
|
||||
<title>Head Metadatas customized title!</title>
|
||||
<title>Head Metadata customized title!</title>
|
||||
<meta charSet="utf-8" />
|
||||
<meta name="twitter:card" content="summary" />
|
||||
<link rel="canonical" href="https://docusaurus.io/docs/markdown-features/head-metadatas" />
|
||||
<link rel="canonical" href="https://docusaurus.io/docs/markdown-features/head-metadata" />
|
||||
</head>
|
||||
<!-- highlight-end -->
|
||||
|
||||
# Head Metadatas
|
||||
# Head Metadata
|
||||
|
||||
My text
|
||||
```
|
||||
|
@ -37,10 +37,10 @@ My text
|
|||
<head>
|
||||
<html className="some-extra-html-class" />
|
||||
<body className="other-extra-body-class" />
|
||||
<title>Head Metadatas customized title!</title>
|
||||
<title>Head Metadata customized title!</title>
|
||||
<meta charSet="utf-8" />
|
||||
<meta name="twitter:card" content="summary" />
|
||||
<link rel="canonical" href="https://docusaurus.io/docs/markdown-features/head-metadatas" />
|
||||
<link rel="canonical" href="https://docusaurus.io/docs/markdown-features/head-metadata" />
|
||||
</head>
|
||||
```
|
||||
|
||||
|
@ -48,7 +48,7 @@ My text
|
|||
|
||||
This `<head>` declaration has been added to the current Markdown doc, as a demo.
|
||||
|
||||
Open your browser DevTools and check how this page's metadatas have been affected.
|
||||
Open your browser DevTools and check how this page's metadata have been affected.
|
||||
|
||||
:::
|
||||
|
|
@ -11,12 +11,12 @@ Docusaurus supports search engine optimization in a variety of ways.
|
|||
|
||||
## Global metadata {#global-metadata}
|
||||
|
||||
Provide global meta attributes for the entire site through the [site configuration](./configuration.md#site-metadata). The metadatas will all be rendered in the HTML `<head>` using the key-value pairs as the prop name and value.
|
||||
Provide global meta attributes for the entire site through the [site configuration](./configuration.md#site-metadata). The metadata will all be rendered in the HTML `<head>` using the key-value pairs as the prop name and value.
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
themeConfig: {
|
||||
metadatas: [{name: 'keywords', content: 'cooking, blog'}],
|
||||
metadata: [{name: 'keywords', content: 'cooking, blog'}],
|
||||
// This would become <meta name="keywords" content="cooking, blog"> in the generated HTML
|
||||
},
|
||||
};
|
||||
|
@ -28,7 +28,7 @@ To read more about types of meta tags, visit [the MDN docs](https://developer.mo
|
|||
|
||||
## Single page metadata {#single-page-metadata}
|
||||
|
||||
Similar to [global metadata](#global-metadata), Docusaurus also allows for the addition of meta-information to individual pages. Follow [this guide](./guides/markdown-features/markdown-features-head-metadatas.mdx) for configuring the `<head>` tag. In short:
|
||||
Similar to [global metadata](#global-metadata), Docusaurus also allows for the addition of meta-information to individual pages. Follow [this guide](./guides/markdown-features/markdown-features-head-metadata.mdx) for configuring the `<head>` tag. In short:
|
||||
|
||||
```md title="my-markdown-page.md"
|
||||
# A cooking guide
|
||||
|
|
|
@ -327,7 +327,7 @@ const config = {
|
|||
additionalLanguages: ['java'],
|
||||
},
|
||||
image: 'img/docusaurus-soc.png',
|
||||
// metadatas: [{name: 'twitter:card', content: 'summary'}],
|
||||
// metadata: [{name: 'twitter:card', content: 'summary'}],
|
||||
gtag: !isDeployPreview
|
||||
? {
|
||||
trackingID: 'UA-141789564-1',
|
||||
|
|
|
@ -52,7 +52,7 @@ const sidebars = {
|
|||
'guides/markdown-features/assets',
|
||||
'guides/markdown-features/plugins',
|
||||
'guides/markdown-features/math-equations',
|
||||
'guides/markdown-features/head-metadatas',
|
||||
'guides/markdown-features/head-metadata',
|
||||
],
|
||||
},
|
||||
'styling-layout',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue