release: bump version to 0.42.2
This commit is contained in:
@@ -11,6 +11,7 @@ import {
|
||||
extractHeadings,
|
||||
getDocsEntries,
|
||||
getDocsEntry,
|
||||
getDocsGroupLabel,
|
||||
groupDocsEntries,
|
||||
slugFromDocsHref,
|
||||
} from './docs-content'
|
||||
@@ -252,15 +253,19 @@ export default function Docs() {
|
||||
<Link className="docs-brand" to="/docs">
|
||||
<span className="docs-brand__mark">P</span>
|
||||
<span>
|
||||
<span className="docs-brand__title">Planet Docs</span>
|
||||
<span className="docs-brand__subtitle">Developer guide</span>
|
||||
<span className="docs-brand__title">
|
||||
{lang === 'zh' ? '星球计划文档' : 'Planet Docs'}
|
||||
</span>
|
||||
<span className="docs-brand__subtitle">
|
||||
{lang === 'zh' ? '开发者和用户手册' : 'Developer & User Guide'}
|
||||
</span>
|
||||
</span>
|
||||
</Link>
|
||||
|
||||
<Scrollbar className="docs-nav">
|
||||
{groupedEntries.map((group) => (
|
||||
<section key={group.group} className="docs-nav__group">
|
||||
<h2 className="docs-nav__heading">{group.group}</h2>
|
||||
<h2 className="docs-nav__heading">{getDocsGroupLabel(group.group, lang)}</h2>
|
||||
{group.entries.map((entry) => {
|
||||
const isActive = entry.slug === activeSlug
|
||||
return (
|
||||
@@ -320,7 +325,9 @@ export default function Docs() {
|
||||
<section className="docs-shell">
|
||||
<header className="docs-header">
|
||||
<div>
|
||||
<p className="docs-header__eyebrow">{activeEntry?.group || 'Docs'}</p>
|
||||
<p className="docs-header__eyebrow">
|
||||
{activeEntry ? getDocsGroupLabel(activeEntry.group, lang) : 'Docs'}
|
||||
</p>
|
||||
<h1 className="docs-header__title">{activeEntry?.title || 'Document not found'}</h1>
|
||||
</div>
|
||||
|
||||
@@ -356,7 +363,9 @@ export default function Docs() {
|
||||
onClick={() => handleSearchSelect(result.entry.slug)}
|
||||
>
|
||||
<span className="docs-search__result-title">{result.entry.title}</span>
|
||||
<span className="docs-search__result-meta">{result.entry.group}</span>
|
||||
<span className="docs-search__result-meta">
|
||||
{getDocsGroupLabel(result.entry.group, lang)}
|
||||
</span>
|
||||
<span className="docs-search__result-excerpt">{result.excerpt}</span>
|
||||
</button>
|
||||
))
|
||||
|
||||
@@ -21,6 +21,29 @@ interface DocsMetadataEntry {
|
||||
en: { title: string; group: DocsGroup; order: number }
|
||||
}
|
||||
|
||||
const DOCS_GROUP_LABELS: Record<DocsLang, Record<DocsGroup, string>> = {
|
||||
zh: {
|
||||
Overview: '概览',
|
||||
Manual: '使用手册',
|
||||
Earth: '地球可视化',
|
||||
Frontend: '前端',
|
||||
Backend: '后端',
|
||||
Agents: '智能体',
|
||||
Ops: '运维',
|
||||
Other: '其他',
|
||||
},
|
||||
en: {
|
||||
Overview: 'Overview',
|
||||
Manual: 'Manual',
|
||||
Earth: 'Earth',
|
||||
Frontend: 'Frontend',
|
||||
Backend: 'Backend',
|
||||
Agents: 'Agents',
|
||||
Ops: 'Ops',
|
||||
Other: 'Other',
|
||||
},
|
||||
}
|
||||
|
||||
const DOCS_README_FILENAME = 'README.md'
|
||||
const FALLBACK_DOCS_ORDER = 999
|
||||
const MAX_HEADING_ID_LENGTH = 80
|
||||
@@ -42,7 +65,7 @@ const DOCS_METADATA: Record<string, DocsMetadataEntry> = {
|
||||
en: { title: 'Technical Docs', group: 'Overview', order: 0 },
|
||||
},
|
||||
'quickstart.md': {
|
||||
zh: { title: 'Quickstart', group: 'Manual', order: 1 },
|
||||
zh: { title: '快速开始', group: 'Manual', order: 1 },
|
||||
en: { title: 'Quickstart', group: 'Manual', order: 1 },
|
||||
},
|
||||
'manual.md': {
|
||||
@@ -50,7 +73,7 @@ const DOCS_METADATA: Record<string, DocsMetadataEntry> = {
|
||||
en: { title: 'Planet Manual', group: 'Manual', order: 2 },
|
||||
},
|
||||
'earth-frontend-context.md': {
|
||||
zh: { title: 'Earth Frontend Context', group: 'Earth', order: 10 },
|
||||
zh: { title: 'Earth 前端结构', group: 'Earth', order: 10 },
|
||||
en: { title: 'Earth Frontend Context', group: 'Earth', order: 10 },
|
||||
},
|
||||
'earth-layer-style-reference.md': {
|
||||
@@ -62,23 +85,23 @@ const DOCS_METADATA: Record<string, DocsMetadataEntry> = {
|
||||
en: { title: 'Earth Render Layer Order', group: 'Earth', order: 12 },
|
||||
},
|
||||
'earth-satellite-footprint-policy.md': {
|
||||
zh: { title: 'Earth Satellite Footprint Policy', group: 'Earth', order: 13 },
|
||||
zh: { title: 'Earth 卫星覆盖策略', group: 'Earth', order: 13 },
|
||||
en: { title: 'Earth Satellite Footprint Policy', group: 'Earth', order: 13 },
|
||||
},
|
||||
'earth-bgp-context.md': {
|
||||
zh: { title: 'BGP Context', group: 'Earth', order: 14 },
|
||||
zh: { title: 'BGP 态势上下文', group: 'Earth', order: 14 },
|
||||
en: { title: 'BGP Context', group: 'Earth', order: 14 },
|
||||
},
|
||||
'earth-news-live-streams-collector-format.md': {
|
||||
zh: { title: 'News Live Streams Collector Format', group: 'Earth', order: 15 },
|
||||
zh: { title: '新闻直播采集格式', group: 'Earth', order: 15 },
|
||||
en: { title: 'News Live Streams Collector Format', group: 'Earth', order: 15 },
|
||||
},
|
||||
'frontend-admin-frontend-context.md': {
|
||||
zh: { title: 'Admin Frontend Context', group: 'Frontend', order: 20 },
|
||||
zh: { title: '控制台前端结构', group: 'Frontend', order: 20 },
|
||||
en: { title: 'Admin Frontend Context', group: 'Frontend', order: 20 },
|
||||
},
|
||||
'frontend-layout-guidelines.md': {
|
||||
zh: { title: 'Frontend Layout Guidelines', group: 'Frontend', order: 21 },
|
||||
zh: { title: '前端布局指南', group: 'Frontend', order: 21 },
|
||||
en: { title: 'Frontend Layout Guidelines', group: 'Frontend', order: 21 },
|
||||
},
|
||||
'backend-collectors.md': {
|
||||
@@ -86,11 +109,11 @@ const DOCS_METADATA: Record<string, DocsMetadataEntry> = {
|
||||
en: { title: 'Data Collectors', group: 'Backend', order: 30 },
|
||||
},
|
||||
'backend-system-service-control.md': {
|
||||
zh: { title: 'System Service Control', group: 'Backend', order: 31 },
|
||||
zh: { title: '系统服务控制', group: 'Backend', order: 31 },
|
||||
en: { title: 'System Service Control', group: 'Backend', order: 31 },
|
||||
},
|
||||
'agents-aiprovider.md': {
|
||||
zh: { title: 'AI Provider Guide', group: 'Agents', order: 40 },
|
||||
zh: { title: 'AI Provider 指南', group: 'Agents', order: 40 },
|
||||
en: { title: 'AI Provider Guide', group: 'Agents', order: 40 },
|
||||
},
|
||||
'ops-docker-compose-buildx-upgrade.md': {
|
||||
@@ -154,6 +177,10 @@ export function groupDocsEntries(entries: DocsEntry[]): Array<{ group: DocsGroup
|
||||
})).filter((group) => group.entries.length > 0)
|
||||
}
|
||||
|
||||
export function getDocsGroupLabel(group: DocsGroup, lang: DocsLang): string {
|
||||
return DOCS_GROUP_LABELS[lang][group]
|
||||
}
|
||||
|
||||
export function createHeadingId(text: string, usedIds: Map<string, number>): string {
|
||||
const base = text
|
||||
.toLowerCase()
|
||||
|
||||
Reference in New Issue
Block a user