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

[v3] fix not rendered default <meta name="description" /> and <meta property="og:description" /> #3133

Merged
merged 2 commits into from
Aug 21, 2024
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
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