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

Update start.mdx - static exports #2563

Merged
merged 5 commits into from
Sep 28, 2024
Merged
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
50 changes: 50 additions & 0 deletions docs/pages/docs/guide/static-exports.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import { Steps } from 'nextra/components'

# Static Exports

Export your pages statically, and deploy with [Nginx](https://nginx.org),
[GitHub Pages](https://pages.github.com) and more.

## Getting Started

<Steps>

### Configuration

```js filename="next.config.mjs"
import nextra from 'nextra'

/**
* @type {import('next').NextConfig}
*/
const nextConfig = {
output: 'export',
images: {
unoptimized: true // mandatory, otherwise won't export
}
// Optional: Change the output directory `out` -> `dist`
// distDir: "build"
}
const withNextra = nextra({
theme: 'nextra-theme-docs',
themeConfig: './theme.config.tsx'
})

export default withNextra(nextConfig)
```

### Building

Run the `build` command according to your package manager:

```sh npm2yarn
npm run build
```

By default, static export will be stored in `out` directory in the root of your
project.

For more in detail documentation for static export visit
[Next.js docs](https://nextjs.org/docs/pages/building-your-application/deploying/static-exports).

</Steps>
Loading