Skip to content

Commit 672888b

Browse files
joeylee12629-starjoey
andauthored
fix: sync zh sidebar titles with article H1 + add GitHub button to zh homepage (#41)
Co-authored-by: joey <joey@joeydeMacBook-Air.local>
1 parent b7db487 commit 672888b

2 files changed

Lines changed: 30 additions & 17 deletions

File tree

site/app/zh/page.tsx

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,28 @@ export default function ZhHomePage() {
2020
<p className="text-lg text-[var(--color-text-secondary)] max-w-2xl mx-auto mb-10">
2121
从零到一学习 AI Agent Harness 的设计、实现和优化。每篇配有可运行的代码示例。
2222
</p>
23-
<Link
24-
href="/zh/guide/what-is-harness"
25-
className="inline-flex items-center gap-2 px-6 py-3 text-sm font-medium text-[var(--color-bg-primary)] bg-[var(--color-accent-cyan)] rounded-lg hover:opacity-90 transition-opacity"
26-
>
27-
开始学习
28-
<svg className="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor">
29-
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M17 8l4 4m0 0l-4 4m4-4H3" />
30-
</svg>
31-
</Link>
23+
<div className="flex flex-wrap justify-center gap-4">
24+
<Link
25+
href="/zh/guide/what-is-harness"
26+
className="inline-flex items-center gap-2 px-6 py-3 text-sm font-medium text-[var(--color-bg-primary)] bg-[var(--color-accent-cyan)] rounded-lg hover:opacity-90 transition-opacity"
27+
>
28+
开始学习
29+
<svg className="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor">
30+
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M17 8l4 4m0 0l-4 4m4-4H3" />
31+
</svg>
32+
</Link>
33+
<a
34+
href="https://github.com/nexu-io/harness-engineering-guide"
35+
target="_blank"
36+
rel="noopener noreferrer"
37+
className="inline-flex items-center gap-2 px-6 py-3 text-sm font-medium text-[var(--color-text-secondary)] bg-[var(--color-bg-card)] border border-[var(--color-border)] rounded-lg hover:border-[var(--color-border-hover)] hover:text-[var(--color-text-primary)] transition-all"
38+
>
39+
<svg className="w-4 h-4" fill="currentColor" viewBox="0 0 24 24">
40+
<path d="M12 0C5.374 0 0 5.373 0 12c0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23A11.509 11.509 0 0112 5.803c1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576C20.566 21.797 24 17.3 24 12c0-6.627-5.373-12-12-12z" />
41+
</svg>
42+
GitHub ★
43+
</a>
44+
</div>
3245
</div>
3346
</section>
3447

site/lib/guide-data.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export const guideSections: GuideSection[] = [
1313
zhLabel: "入门",
1414
items: [
1515
{ slug: "what-is-harness", title: "What is a Harness?", zhTitle: "什么是 Harness?" },
16-
{ slug: "your-first-harness", title: "Your First Harness", zhTitle: "搭建你的第一个 Harness" },
16+
{ slug: "your-first-harness", title: "Your First Harness", zhTitle: "你的第一个 Harness" },
1717
{ slug: "harness-vs-framework", title: "Harness vs. Framework", zhTitle: "Harness 与 Framework 的区别" },
1818
],
1919
},
@@ -23,8 +23,8 @@ export const guideSections: GuideSection[] = [
2323
zhLabel: "核心概念",
2424
items: [
2525
{ slug: "agentic-loop", title: "Agentic Loop", zhTitle: "Agentic Loop" },
26-
{ slug: "tool-system", title: "Tool System", zhTitle: "Tool System" },
27-
{ slug: "memory-and-context", title: "Memory & Context", zhTitle: "Memory & Context" },
26+
{ slug: "tool-system", title: "Tool System", zhTitle: "Tool 系统" },
27+
{ slug: "memory-and-context", title: "Memory & Context", zhTitle: "Memory Context" },
2828
{ slug: "guardrails", title: "Guardrails", zhTitle: "Guardrails" },
2929
],
3030
},
@@ -33,19 +33,19 @@ export const guideSections: GuideSection[] = [
3333
label: "Practice",
3434
zhLabel: "实战",
3535
items: [
36-
{ slug: "context-engineering", title: "Context Engineering", zhTitle: "Context Engineering" },
37-
{ slug: "sandbox", title: "Sandbox", zhTitle: "Sandbox 实战" },
38-
{ slug: "skill-system", title: "Skill System", zhTitle: "Skill System" },
36+
{ slug: "context-engineering", title: "Context Engineering", zhTitle: "Context 工程" },
37+
{ slug: "sandbox", title: "Sandbox", zhTitle: "Sandbox" },
38+
{ slug: "skill-system", title: "Skill System", zhTitle: "Skill 系统" },
3939
{ slug: "sub-agent", title: "Sub-Agent", zhTitle: "Sub-Agent" },
40-
{ slug: "error-handling", title: "Error Handling", zhTitle: "Error Handling" },
40+
{ slug: "error-handling", title: "Error Handling", zhTitle: "错误处理" },
4141
],
4242
},
4343
{
4444
id: "reference",
4545
label: "Reference",
4646
zhLabel: "参考",
4747
items: [
48-
{ slug: "comparison", title: "Implementation Comparison", zhTitle: "实现对比" },
48+
{ slug: "comparison", title: "Implementation Comparison", zhTitle: "主流 Harness 实现对比" },
4949
{ slug: "glossary", title: "Glossary", zhTitle: "术语表" },
5050
],
5151
},

0 commit comments

Comments
 (0)