Next.jsReact文档

skyl_docs — Next.js 文档模板

作者 BAGOMBEKA-JOB-DEV

SKYL 的官方文档站,基于 Next.js 15 App Router 构建,分为 Learn 与 Reference 两条阅读路径,内容以 MDX 编写,并配有 Go 代码片段编译校验与链接检查。

看看你的网站会是什么样

浏览真实页面截图,比较内容排版与手机效果。点击下方缩略图切换,放大查看整页细节。

3 个预览视图
桌面端首页1 / 3
桌面端截图首屏预览

由服务器浏览器实际访问页面后截取。

全部页面与视图 3

截图用于了解视觉与布局,交互效果请以实际项目为准。

采集于 2026-10-05查看来源

值得关注的模板亮点

从已有项目资料中,快速了解它的特点。

01

Learn 与 Reference 双轨内容结构,分别面向顺序阅读与按符号查阅

02

160 个 MDX 页面,配合仓库内定义的 MDX 组件词汇与页面模板

03

check:snippets 将标记 verify 的 Go 代码块放入独立包并针对本地 skyl 检出做类型检查

04

check:links 校验侧边栏条目、页面文件与内部链接的一致性

05

构建输出为 out/ 静态目录,可部署到 nginx、S3、Netlify、Vercel、Cloudflare Pages 等静态托管

06

表格数据由 src/data/ 从 Go 源码提取,页面组件渲染而非手工编写

模板详细介绍

这是 SKYL(一个为多种 AI 模型提供统一 Go 接口的库)的文档站点。站点使用 Next.js 15 的 App Router,内容主体是 160 个 MDX 页面,按 Learn(叙事性、按顺序阅读)和 Reference(每个符号一页)两条路径组织,并共享一套页面模板与 MDX 组件词汇。

内容结构上,侧边栏定义在 src/sidebars/ 下,页面文件放在 src/content/ 对应路径,构建时通过 check:links 校验两者是否一致。表格数据来自 src/data/,由 Go 源码提取,避免手工维护造成事实漂移。public/md/ 下的 166 个 Markdown 文件由 prebuild 脚本从 MDX 生成,不应手工编辑。

质量保障方面,仓库提供 verify 脚本串联 lint、类型检查、单元测试、构建、链接检查、Go 片段编译与端到端测试。其中 check:snippets 会把标记为 verify 的 Go 代码块放入独立包中,通过 replace 指向本地 skyl 检出并做类型检查;缺少 Go 或 skyl 检出时会跳过并给出提示。构建产物为 out/ 目录的静态导出,可部署到任意静态托管;SITE_URL 用于生成规范链接、sitemap 与 robots。

限制与注意:文档内容采用 CC BY 4.0,代码采用 Apache-2.0,第三方素材需单独核对许可;站点部署与网关部署是两回事,网关部署在 skyl_infrastructure 仓库中。

Next.jsReact文档

适合你的项目吗?

适用场景

  • 为 SKYL Go 库搭建或维护官方文档站点
  • 需要同时提供教程式阅读路径与 API 符号参考的文档项目
  • 希望通过 MDX 组件与数据层统一页面模板、减少事实漂移的文档工程
  • 在 CI 中校验文档代码片段可编译、链接与侧边栏一致性的场景

适合人群

  • 维护 Go 库文档并希望代码示例可验证的团队
  • 使用 Next.js App Router 与 MDX 构建静态文档站的开发者
  • 需要将文档站部署为纯静态产物、不依赖 Node 运行时的项目

上手与定制指南

结合仓库当前版本的说明,按下面的资料检查内容、配置与运行要求。

  1. 1

    运行 npm install 安装依赖,npm run dev 启动本地开发服务器(默认 http://localhost:3000)

  2. 2

    npm run verify 串联 lint、类型检查、单元测试、构建、链接检查、Go 片段编译与端到端测试

  3. 3

    check:snippets 需要本地 Go 工具链与 skyl 检出,可用 --skyl 指定路径,缺失时会跳过并提示

  4. 4

    构建时设置 SITE_URL 为站点实际来源,否则会回退到 http://localhost:3000

  5. 5

    public/md/ 下的 Markdown 由 prebuild 从 MDX 生成,修改内容应编辑 src/content/ 中的 MDX 源文件

查看仓库使用说明

授权与来源资料

使用条件与限制

免费使用 · 保留许可声明

本次收录的是公开仓库中采用 Apache-2.0 许可的免费版本;免费范围为该版本代码,不代表外部服务或第三方素材免费。

使用时需要遵守

  • 允许免费使用、修改、商用和分发;分发时需随附 Apache-2.0 许可证。
  • 修改过的文件需显著标明改动,并保留相关版权、专利、商标及归属声明。
  • 若原项目附有 NOTICE 文件,分发衍生作品时需保留其中适用的归属声明。
  • 许可包含适用的贡献者专利授权;发起许可所述专利诉讼会终止该专利授权,且不授予商标使用权。
  • 代码按现状提供;担保与责任限制以原许可证及适用法律为准。

额外费用与待核对事项

  • 演示图片、字体、图标及其他第三方素材需按各自许可核对,不能仅凭代码的 Apache-2.0 许可判断。
  • 域名、托管、数据库、支付或 AI 等外部服务可能另外收费。
  • 文档内容采用 CC BY 4.0 许可,与代码的 Apache-2.0 不同;若复用本站文档文本,需遵守 CC BY 4.0 的署名等条件。
  • check:snippets 需要本地 Go 工具链与 skyl 库检出,通过 replace 指向本地 skyl 检出进行类型检查;缺少 Go 或 skyl 检出时会跳过而非失败。
  • 运行片段校验需通过 --skyl 指定本地 skyl 仓库路径,即依赖外部仓库检出,而非仅本仓库即可完成。
  • 发布站点时必须设置 SITE_URL 环境变量,否则规范链接、sitemap 与 robots 会回退到 http://localhost:3000,不适合正式发布。
  • 本站仅覆盖文档站本身;网关部署属于另一仓库 skyl_infrastructure,不在本模板范围内。
  • public/md/ 下的 Markdown 为构建时生成并提交,手工修改会在下次构建时被覆盖,内容应编辑 src/content/ 中的 MDX 源文件。
查看原文依据

no-charge, royalty-free, irrevocable copyright license

许可证原文

Documentation is CC BY 4.0; skyl itself is Apache 2.0.

README 原文

`npm run check:snippets` | **Every `verify` Go snippet compiles against the real library**

README 原文

node scripts/check-snippets.mjs --skyl ../skyl

README 原文

Set `SITE_URL` to the origin the site will be served from.

README 原文

Deploying the *gateway* is a different problem and lives elsewhere — see [skyl_infrastructure](https://github.com/BAGOMBEKA-JOB-DEV/skyl_infrastructure).

README 原文

`public/md/` holds 166 committed `.md` files. They are **generated** from the MDX by `prebuild`, so a hand edit survives exactly until the next `npm run build` and then disappears with no diff to explain it. Edit the MDX.

README 原文
https://github.com/BAGOMBEKA-JOB-DEV/skyl_docs/blob/main/LICENSEhttps://github.com/BAGOMBEKA-JOB-DEV/skyl_docs/blob/main/README.md

DeepSeek 根据仓库许可证和 README 整理 ·2026-10-05。结果仅覆盖已读取资料,依赖、图片、字体及后续条款变更以各自原文为准。

项目核对记录与介绍依据

模板资料

来源平台
GitHub
资料与维护参考分
资料较完整 · 88 / 100
技术栈
Next.js · React
网站类型
文档
这个分数如何计算

本站按许可资料(最高30分)、演示链接(12分)、预览图(10分)、Star数(15分)、记录的维护时间(15分)、描述完整度(8分)、功能记录(5分)和分类资料(5分)计算。它不是代码、安全或性能测试,也不是 Google 评分;有链接不代表已实测可用。

这个项目需要核对什么

记录的仓库更新时间
2026-10-05
截图检查日期
2026-10-05

已收录演示链接。请用你的内容与屏幕尺寸检查;有演示不代表表单、认证或支付已经可用。

目录记录的主要技术栈是 Next.js。请通过依赖清单和锁文件核对实际版本与托管要求。这些说明基于收录资料,不代表代码审计或部署实测。

查看具体选型方法 →

介绍的制作与核对状态

介绍由 AI 辅助整理目录与仓库资料。仓库作者不等于这篇介绍的审核者。

审核声明: [email protected] · 2026-10-05

查看当时使用的来源资料

SHA-256: 587988b063a13114a0879c9a58d7c35c98612b31d4ce2fda698c3d6ce6be8cdd

2026-10-05T10:27:48.362Z

来源文件 / 仓库
# skyl documentation

[![Go Reference](https://pkg.go.dev/badge/github.com/BAGOMBEKA-JOB-DEV/skyl.svg)](https://pkg.go.dev/github.com/BAGOMBEKA-JOB-DEV/skyl)

The documentation site for [skyl](https://github.com/BAGOMBEKA-JOB-DEV/skyl) —
*one Go interface for every AI model*.

Built with Next.js 15 (App Router). Two tracks — **Learn** for narrative,
read-in-order material and **Reference** for one page per symbol — sharing a
strict set of page templates and an MDX component vocabulary owned in this
repository.

## Running it

```bash
npm install
npm run dev          # http://localhost:3000
```

## Verifying it

```bash
npm run verify       # lint, typecheck, unit tests, build, links, snippets
```

Individually:

| Command | What it proves |
|---|---|
| `npm run lint` | ESLint, flat config |
| `npm run typecheck` | TypeScript, strict, `noUncheckedIndexedAccess` |
| `npm run test` | Vitest over the data layer |
| `npm run build` | Static export succeeds |
| `npm run check:links` | Every sidebar entry has a page, every page is linked, every internal link resolves, no placeholders |
| `npm run check:snippets` | **Every `verify` Go snippet compiles against the real library** |
| `npm run test:e2e` | Playwright walks every route and exercises search, theming, tabs and the matrix |

### The snippet checker

`scripts/check-snippets.mjs` extracts every fenced Go block marked `verify`,
assembles each into its own package with a `replace` onto a local skyl checkout,
and type-checks it.

```bash
node scripts/check-snippets.mjs --skyl ../skyl
node scripts/check-snippets.mjs --keep      # leave .snippet-check/ for debugging
```

`verify` renders a **Compiles** badge, so it means exactly one thing: this
snippet type-checks standalone. Snippets that are excerpts — referring to a
helper defined three paragraphs earlier — deliberately do not carry it, and
`scripts/demote-snippets.mjs` strips the marker from any that stop compiling.

It skips with a message rather than failing when Go or the skyl checkout is
absent, and adapts to the local toolchain: `provider/anthropic` needs Go 1.24,
so on an older toolchain a stub stands in and the core is still verified against
its real 1.22 floor.

## Structure

```
src/
├── app/            Next App Router — (home), learn, reference, community
├── components/
│   ├── mdx/        The component vocabulary: Intro, YouWillLearn, Recap,
│   │               Challenges, DeepDive, Pitfall, ProviderTabs, GoExample…
│   ├── layout/     Header, sidebar, TOC, breadcrumbs, search, prev/next
│   ├── home/       Hero and the animated provider swap
│   └── feature-matrix/  The interactive matrix
├── content/        160 MDX pages
├── data/           Typed data extracted from the Go source — every table on
│                   the site renders from here rather than being hand-written
├── sidebars/       learn.ts, reference.ts, community.ts, blog.ts
├── lib/            MDX pipeline, Shiki highlighting, search index
└── config/site.ts  Version, module table, top nav
```

### How a page becomes a file

Worth knowing before editing anything, because one of the outputs is committed,
looks editable, and is not:

```mermaid
flowchart LR
    mdx[["src/content/**/*.mdx<br/><b>the source</b>"]]
    side["src/sidebars/*.ts"]
    data["src/data/*<br/>extracted from the Go source"]

    mdx --> next["next build"]
    side --> next
    data --> next

    mdx --> emit["scripts/emit-markdown.mjs<br/>runs as prebuild"]

    next --> out["out/<br/>static export · gitignored"]
    emit --> pub[["public/md/**/*.md<br/><b>generated · committed</b><br/>serves the Copy page button"]]

    edit(["edit here"]) -.-> mdx
    dont(["never here —<br/>overwritten every build"]) -.-> pub

    style mdx stroke-width:3px
    style pub stroke-dasharray:5 4
```

`public/md/` holds 166 committed `.md` files. They are **generated** from the
MDX by `prebuild`, so a hand edit survives exactly until the next
`npm run build` and then disappears with no diff to explain it. Edit the MDX.

## Adding a page

1. Add an entry to the relevant file in `src/sidebars/`.
2. Create the MDX at the matching path under `src/content/`.
3. Run `npm run check:links` — it fails if the two disagree.

Frontmatter needs a `title`; `description` and `badge` are optional.

## Writing content

**Learn pages** follow: `<Intro>` → `<YouWillLearn>` → narrative → `<Recap>` →
`<Challenges>` with `<Hint>` and `<Solution>`.

**Reference pages** follow: `<Intro>` → **Reference** (`<Signature>`,
`<Parameters>`, `<Returns>`, `<Caveats>`) → **Usage** (`<Recipe>`) →
**Troubleshooting** (`<Trouble>`).

Tables come from `src/data/` through the components in
`src/components/mdx/data-views.tsx` — never hand-write a grid, or the same fact
drifts between pages.

Mark a Go fence `verify` when it should compile:

````
```go title="main.go" verify
client := skyl.New(openai.New(key))
```
````

## Deployment

`npm run build` produces a fully static export in `out/` — no Node server at
runtime. Copy that directory to any static host: nginx, S3, Netlify, Vercel,
Cloudflare Pages.

Set `SITE_URL` to the origin the site will be served from. It becomes the
canonical URL in `sitemap.xml` and `robots.txt` and the `og:url` on every page;
unset, it falls back to `http://localhost:3000`, which is right for local work
and wrong for anything published.

```bash
SITE_URL=https://docs.example.com npm run build
```

CI (`.github/workflows/ci.yml`) runs lint, typecheck, unit tests, the build, the
link check, the Go snippet compiler and the end-to-end suite, and uploads `out/`
as a build artefact — so a built site is downloadable from any run without a
deployment step.

Deploying the *gateway* is a different problem and lives elsewhere — see
[skyl_infrastructure](https://github.com/BAGOMBEKA-JOB-DEV/skyl_infrastructure).
This section is only about the site.

## The three repositories

| Repository | What it is |
|---|---|
| [skyl](https://github.com/BAGOMBEKA-JOB-DEV/skyl) | The Go library, the adapters, and the gateway — the thing being documented |
| **[skyl_docs](https://github.com/BAGOMBEKA-JOB-DEV/skyl_docs)** | This one — the [documentation site](https://skyl-docs.vercel.app/) |
| [skyl_infrastructure](https://github.com/BAGOMBEKA-JOB-DEV/skyl_infrastructure) | Deployment: Terraform for AWS/GCP/Azure, the Helm chart, CI |

The split is deliberate: a docs change never touches the library's release
history, and neither does an infrastructure change. The cost is that the same
fact can drift across three repositories — which is why `check:snippets`
compiles every `verify` Go block against a real skyl checkout rather than
trusting that the prose kept up.

**Diagrams differ between repositories, on purpose.** Here they are React
components — `Diagram`, `AsciiDiagram`, `ClientStackDiagram` in
`src/components/mdx/diagram.tsx` — rendered as inline SVG or pre-formatted ASCII
so they inherit the page theme and scale with the reader's font size. An image
would be wrong in one theme or the other. The two GitHub-only repositories use
mermaid in markdown instead, because GitHub renders it natively and there is no
build step to hook. A diagram does not move between the two unchanged.

## Licence

Documentation is CC BY 4.0; skyl itself is Apache 2.0.
反馈内容错误

看看同类模板

对比同技术栈与用途的模板,找到更适合的视觉与内容结构。