Skip to content

Commit

Permalink
[v3] fix not rendered default <meta name="description" /> and `<met…
Browse files Browse the repository at this point in the history
…a property="og:description" />` (#3133)

* aa

* prettier
  • Loading branch information
dimaMachina authored Aug 21, 2024
1 parent 19dbcc8 commit 6945f38
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
5 changes: 5 additions & 0 deletions .changeset/light-bats-sin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'nextra-theme-docs': patch
---

fix not rendered default `<meta name="description" />` and `<meta property="og:description" />`
4 changes: 3 additions & 1 deletion docs/pages/docs/guide/built-ins/filetree.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ Click the folder to test the dynamic functionality of the file tree.

## Usage

Create the file tree structure by nesting `<FileTree.Folder>` and `<FileTree.File>` components within a `<FileTree>`. Name each file or folder with the `name` attribute. Use `defaultOpen` to set the folder to open on load.
Create the file tree structure by nesting `<FileTree.Folder>` and
`<FileTree.File>` components within a `<FileTree>`. Name each file or folder
with the `name` attribute. Use `defaultOpen` to set the folder to open on load.

```mdx filename="MDX"
import { FileTree } from 'nextra/components'
Expand Down
11 changes: 5 additions & 6 deletions packages/nextra-theme-docs/src/constants.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,11 @@ export const DEFAULT_THEME: DocsThemeConfig = {
<>
<title>{title}</title>
<meta property="og:title" content={title} />
{description && (
<>
<meta name="description" content={description} />
<meta property="og:description" content={description} />
</>
)}
{/* We can't use React.Fragment https://nextjs.org/docs/pages/api-reference/components/head#use-minimal-nesting https:/vercel/next.js/pull/67667 */}
{description && [
<meta key={0} name="description" content={description} />,
<meta key={1} property="og:description" content={description} />
]}
{canonical && <link rel="canonical" href={canonical} />}
{image && <meta name="og:image" content={image} />}
</>
Expand Down

0 comments on commit 6945f38

Please sign in to comment.