nextra README

The project's README from github.com/shuding/nextra. As one markdown file: README.md.

Nextra

Simple, powerful and flexible site generation framework with everything you love from Next.js.

Documentation

https://nextra.site

Development

Installation

The Nextra repository uses PNPM Workspaces and Turborepo.

  1. Run corepack enable to enable Corepack.

    If the command above fails, run npm install -g corepack@latest to install the latest version of Corepack.

  2. Run pnpm install to install the project's dependencies.

Build nextra

pnpm --filter nextra build

Watch mode: pnpm --filter nextra dev

Build nextra-theme-docs

pnpm --filter nextra-theme-docs build

Development

You can also debug them together with a website locally. For instance, to start examples/docs locally, run

pnpm --filter example-docs dev

Any change to example/docs will be re-rendered instantly.

If you update the core or theme packages, a rebuild is required. Or you can use the watch mode for both Nextra and the theme in separated terminals.

Sponsors

Inkeep - AI Agents that get real work done xyflow preview

nextra (shuding/nextra)

Searching Database…

13.9K ·GitHub
这是什么?Nextra 是一个简单、强大且灵活的网站生成框架,拥有你在 Next.js 上喜欢的一切:你用 Markdown/MDX 来写内容,它会把内容变成一个网站,通常用作文档站或博客。
它是托管服务,还是我要加到自己项目里的东西?它是一个用来搭建网站的开发框架,而不是托管服务:这个仓库分为一个核心包和多个独立主题(比如文档主题),你可以基于 Next.js 组合出自己的网站。
我该怎么上手?README 中链接了说明用法的文档;如果想开发 Nextra 本身,先启用 Corepack,然后在仓库里运行 pnpm install。
运行之前需要装好什么?需要一个 Node.js 环境:项目使用 pnpm(通过 Corepack 提供)在 PNPM Workspaces 中构建,并由 Turborepo 驱动构建流程。
自定义时有什么坑?如果更新了核心包或主题包,就需要重新构建——或者在两个终端里分别为 Nextra 和主题开启 watch 模式。
生成的网站跑在哪里?它生成的是一个网站:一个 Next.js 网站,你可以像部署其他网站一样把它部署到网上并托管。
它自带现成的主题吗?仓库开发了一个文档主题(nextra-theme-docs),并保留了文档、博客和 i18n 配置(swr-site)的示例网站;你可以用 dev:theme-docs 这类 pnpm 脚本在本地运行它们。
写作时能实时预览内容改动吗?可以——在本地示例配置下,对 example/docs 的任何改动都会立即重新渲染;核心包或主题的改动则需要重新构建或开启 watch 模式。
这是一个成熟的项目吗?是的:它从 2020 年 6 月就开始了,GitHub 上有约 1.39 万颗星,没有被归档,并且有持续运行 lint、测试和发布的 CI 工作流。
What are similar projects?docusaurus, NotionNext, fumadocs, docs, hexo, next.js, umi, astro
Creator
shuding
Size
40 MB
Stars
13.9K
Age
6y
Commits · 90 Days