1.2.0 (2026-07-24)
【免费下载链接】scalarScalar is an open-source API platform: 🌐 Modern REST API Client 📖 Beautiful API References ✨ 1st-Class OpenAPI/Swagger Support项目地址: https://gitcode.com/GitHub_Trending/sc/scalar
Added a dark mode toggle to the header.
1.1.0 (2026-07-10)
Introduced page actions: copy as Markdown, open in editor, and report an issue.
标题成为条目标题,其下方内容成为条目描述。**只有最上层带日期的标题层级**会开启条目;更深层的标题会折叠进它所属的发布中——即使它碰巧也包含日期。因此你可以把 `### Fixes` 之类的子标题嵌套在某个发布内部而不会将其拆散。 如果标题看起来带日期但日期并不真实(如 `## 2.0.0 (2026-13-01)`),该发布会被排除在源之外,并且构建过程会给出警告——因为唯一走到这一步的原因就是拼写错误。 ### 多产品 Changelog 拆分到多个页面的 Changelog 同样适用:位于 `path` 及其之下的所有页面都会贡献各自的条目,源会把它们按最新优先合并:/changelog <- 索引页,列出各产品 /changelog/api-client <- 条目 /changelog/api-reference <- 条目
一个没有带日期标题的索引页本身不贡献任何条目——当它只负责链接到各产品时,这正是你想要的行为。 被隐藏的页面会被跳过:一个既不在侧边栏、也不在 sitemap 中出现的页面,同样不会出现在源中。 ### 每页一个条目(pages 模式,适合博客) 对博客这类“每篇文章是独立页面”的场景,将 `entries` 设为 `pages`: ```json // scalar.config.json { "$schema": "https://registry.scalar.com/@scalar/schemas/config", "scalar": "2.0.0", "siteConfig": { "rss": { "path": "/blog", "title": "Scalar Blog", "entries": "pages" } } }此时path下每一个 frontmatter 带date的页面都成为一个源条目,按最新优先排序:
--- date: 2026-07-24 --- # Our new dark mode A short introduction to the post.页面标题成为条目标题,描述成为条目描述,frontmatter 中的date决定发布日期。没有date的页面——索引页、草稿——会被排除,因此不会有任何内容被意外地分发出去。
源的可发现性(Discovery)
站点上的每个页面都会在<head>中声明该源,Feed 阅读器和浏览器扩展可以从任意 URL 发现它:
<link rel="alternate" type="application/rss+xml" href="https://example.com/changelog/rss.xml">位于path及其之下的页面还会在页头(Copy Page 旁边)显示订阅按钮,页面属于几个源就显示几个。
仓库自身的 scalar.config.json 就是一个真实例子:rss.path指向/resources/changelog,并附带title与description,与仓库内 documentation/changelog/index.md 所在的 Changelog 结构对应。
十、Routing:URL 重定向与路径模式
routing属性为文档配置 URL 重定向和路径模式。
重定向
用重定向处理 URL 变更或别名:
// scalar.config.json { "$schema": "https://registry.scalar.com/@scalar/schemas/config", "scalar": "2.0.0", "siteConfig": { "routing": { "redirects": [ { "from": "/old-path", "to": "/new-path" }, { "from": "/docs/v1", "to": "/docs/latest" } ] } } }重定向对象属性:
| 属性 | 类型 | 必填 | 说明 |
|---|---|---|---|
from | string | 是 | 要匹配的源路径 |
to | string | 是 | 目标路径 |
路径模式
自定义指南页和 API 参考页的 URL 结构:
"routing": { "guidePathPattern": "/docs/:slug", "referencePathPattern": "/api/:slug" }【免费下载链接】scalarScalar is an open-source API platform: 🌐 Modern REST API Client 📖 Beautiful API References ✨ 1st-Class OpenAPI/Swagger Support项目地址: https://gitcode.com/GitHub_Trending/sc/scalar
创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考