Skip to content

Commit

Permalink
Merge branch 'main' into v4-v2
Browse files Browse the repository at this point in the history
  • Loading branch information
dimaMachina committed Oct 2, 2024
2 parents 84d44e6 + 659b36e commit 9305801
Show file tree
Hide file tree
Showing 30 changed files with 349 additions and 230 deletions.
5 changes: 5 additions & 0 deletions .changeset/breezy-dryers-raise.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'nextra': patch
---

remove `jsx-runtime.cjs`, import runtime from 'react/jsx-runtime'
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.DS_Store
.next/
.tsup/
node_modules/
*.log
dist/
Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ the watch mode for both nextra and the theme in separated terminals.

<div>
<a href="https://speakeasyapi.dev/docs?utm_source=github&utm_campaign=nextra&utm_content=logolink">
<img src="/docs/app/showcase/_logos/speakeasy.png" alt="Speakeasy" width="256">
<img src="/docs/app/showcase/_logos/speakeasy.png" alt="Speakeasy preview" width="256">
</a>
<a href="https://xyflow.com?utm_source=github&utm_campaign=nextra&utm_content=logolink">
<img src="/docs/app/showcase/_logos/xyflow.jpg" alt="xyflow preview" width="256">
</a>
</div>
45 changes: 27 additions & 18 deletions docs/app/_meta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,33 +7,42 @@ export default {
type: 'page',
title: 'Documentation'
},
showcase: {
type: 'page',
theme: {
typesetting: 'article',
layout: 'full'
}
},
about: {
type: 'page',
theme: {
typesetting: 'article'
}
},
version: {
versions: {
type: 'menu',
title: 'Version',
title: 'Versions',
items: {
_3: {
'3': {
title: 'Nextra v3 Docs ↗',
href: 'https://nextra-v2-pyibc76cq-shud.vercel.app',
newWindow: true
},
_2: {
'2': {
title: 'Nextra v2 Docs ↗',
href: 'https://nextra-v2-oe0zrpzjp-shud.vercel.app',
newWindow: true
}
}
}
},
about: {
type: 'page',
theme: {
typesetting: 'article'
}
},
showcase: {
type: 'page',
theme: {
typesetting: 'article',
layout: 'full',
timestamp: false
}
},
sponsors: {
type: 'page',
title: 'Sponsors',
theme: {
typesetting: 'article',
timestamp: false
}
},
}
38 changes: 18 additions & 20 deletions docs/app/about/page.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { Cards } from 'nextra/components'

export const metadata = {
sidebarTitle: 'About'
}
Expand All @@ -10,15 +8,28 @@ Nextra was initially created by [Vercel](https://vercel.com) members
[Shu Ding](https://twitter.com/shuding_) and
[Paco Coursey](https://twitter.com/pacocoursey) in 2020. Since 2021,
[Yixuan Xu](https://twitter.com/yixuanxu94) contributed tremendously to the
project. In 2022, [Dimitri Postolov](https://twitter.com/dimaMachina_) from
project.

In 2022, [Dimitri Postolov](https://twitter.com/dimaMachina_) from
[The Guild](https://the-guild.dev) joined the core team to help with the
development of 2.0.
development of Nextra 2.

In 2024 Nextra 3 was released, current primary maintainer
[Dimitri Postolov](https://twitter.com/dimaMachina_) fully developed it, and
[Oscar Xie](https://github.com/87xie)
[actively contributed](https://github.com/shuding/nextra/pulls?q=sort%3Aupdated-desc+is%3Apr+author%3A87xie+is%3Aclosed+created%3A%3C2024-10-03)
to this release.

In 2024 Nextra 4 prerelease with [App Router](https://nextjs.org/docs/app)
support was released, [Dimitri Postolov](https://twitter.com/dimaMachina_) fully
developed it too. Currently, it's under development and
[we are receiving feedback](https://github.com/shuding/nextra/issues/2600#issuecomment-2385107206).

## Team

Currently, the project is maintained by [Shu Ding](https://twitter.com/shuding_)
and [Dimitri Postolov](https://twitter.com/dimaMachina_). You can check out the
full list of contributors on
Currently, the project is maintained by
[Dimitri Postolov](https://twitter.com/dimaMachina_). You can check out the full
list of contributors on
[GitHub](https://github.com/shuding/nextra/graphs/contributors).

## Credits
Expand Down Expand Up @@ -53,16 +64,3 @@ product.
## License

The Nextra project and themes are licensed under the MIT license.

## Sponsors

<Cards num={2}>
<Cards.Card
title="Speakeasy"
href="https://speakeasyapi.dev/docs?utm_source=nextra.site&utm_campaign=nextra&utm_content=logolink"
target="_blank"
arrow
>
<>![Speakeasy](../showcase/_logos/speakeasy.png)</>
</Cards.Card>
</Cards>
65 changes: 48 additions & 17 deletions docs/app/docs/guide/organize-files/page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,55 @@ page:
</FileTree.Folder>
</FileTree>

<Callout>
It's also possible to use the `.jsx`, `.ts`, `.tsx` extensions for `_meta`
files (e.g. `_meta.ts`)
</Callout>
### Allowed Extensions

For example, you can put this in your `pages/_meta.js` file:
It's possible to use the `.jsx`, `.ts` and `.tsx` extensions for `_meta` files
as well (e.g. `_meta.ts`).

### Sorting Pages Alphabetically

You can use ESLint's built-in `sort-keys` rule, append
`/* eslint sort-keys: error */` comment at the top of your `_meta` file, and you
will receive ESLint's errors about incorrect order.

### Usage with `next-sitemap`

If you are using
[next-sitemap](https://github.com/iamvishnusankar/next-sitemap), you will
probably need to add `exclude: ['*/_meta']{:js}` to your
`next-sitemap.config.js` file, as it is
[tricky to exclude `_meta` files from the build](https://github.com/vercel/next.js/issues/8974#issuecomment-542525837).

### Allowed Keys Values

The type of your `_meta` keys should be always `string` and not `number` since
[numbers are always ordered first](https://dev.to/frehner/the-order-of-js-object-keys-458d)
for JavaScript objects.

Following:

```js filename="pages/_meta.js"
export default {
foo: '',
1992_10_21: '',
1: ''
}
```

Will be converted to:

{/* prettier-ignore */}
```js filename="pages/_meta.js"
export default {
'1': '',
'19921021': '',
foo: ''
}
```

## Example

Put this in your `pages/_meta.js` file:

```js filename="pages/_meta.js"
export default {
Expand All @@ -108,18 +151,6 @@ export default {
}
```

<Callout>
You can use ESLint's built-in rule sort keys with a `/* eslint sort-keys:
error */` comment to sort your sidebar items alphabetically.
</Callout>

<Callout type="warning">
If you are using
[next-sitemap](https://github.com/iamvishnusankar/next-sitemap), you will
probably need to add `exclude: ['*/_meta']` to your `next-sitemap.config.js`
file, as it is tricky to exclude `_meta` files from the build.
</Callout>

The extra configurations are passed to the **theme** as additional information.
Check the corresponding pages for more information:

Expand Down
Binary file added docs/app/showcase/_logos/react-flow.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/app/showcase/_logos/svelte-flow.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/app/showcase/_logos/xyflow.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 9305801

Please sign in to comment.