Skip to content

Commit f658fd7

Browse files
authored
Merge pull request #425 from Yumiue/fix/www-content-sync-main
fix(www): 修正首页安装区块布局、补充缺失文档内容并隐藏全局滚动条
2 parents 82671c7 + 360c023 commit f658fd7

8 files changed

Lines changed: 168 additions & 97 deletions

File tree

www/.vitepress/theme/components/QuickStartCards.vue

Lines changed: 88 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -5,87 +5,101 @@ const props = defineProps<{
55
locale?: 'zh' | 'en'
66
}>()
77
8-
const isEnglish = computed(() => props.locale === 'en')
9-
108
const installUnix = 'curl -fsSL https://raw.githubusercontent.com/1024XEngineer/neo-code/main/scripts/install.sh | bash'
119
const installWindows = 'irm https://raw.githubusercontent.com/1024XEngineer/neo-code/main/scripts/install.ps1 | iex'
1210
const fromSource = `git clone https://github.com/1024XEngineer/neo-code.git
1311
cd neo-code
1412
go run ./cmd/neocode`
15-
const envUnix = `export OPENAI_API_KEY="your_key_here"
16-
export GEMINI_API_KEY="your_key_here"
17-
export AI_API_KEY="your_key_here"
18-
export QINIU_API_KEY="your_key_here"`
19-
const envWindows = `$env:OPENAI_API_KEY = "your_key_here"
20-
$env:GEMINI_API_KEY = "your_key_here"
21-
$env:AI_API_KEY = "your_key_here"
22-
$env:QINIU_API_KEY = "your_key_here"`
23-
</script>
24-
25-
<template>
26-
<div class="quickstart-grid" v-if="isEnglish">
27-
<article class="quickstart-card">
28-
<p class="quickstart-kicker">Try Now</p>
29-
<h3>Install with one command</h3>
30-
<p>Use the same install scripts maintained in the repository README.</p>
31-
<CodePanel language="bash" label="macOS / Linux" :code="installUnix" />
32-
<CodePanel language="powershell" label="Windows PowerShell" :code="installWindows" />
33-
</article>
3413
35-
<article class="quickstart-card">
36-
<p class="quickstart-kicker">From Source</p>
37-
<h3>Run the current codebase</h3>
38-
<p>Best when you want to inspect behavior, debug issues, or contribute changes.</p>
39-
<CodePanel language="bash" label="Clone and run" :code="fromSource" />
40-
</article>
14+
type QuickStartCard = {
15+
key: string
16+
kicker: string
17+
title: string
18+
description: string
19+
panels: Array<{
20+
language: 'bash' | 'powershell'
21+
label: string
22+
code: string
23+
}>
24+
links: Array<{
25+
text: string
26+
code: string
27+
}>
28+
}
4129
42-
<article class="quickstart-card">
43-
<p class="quickstart-kicker">First Run</p>
44-
<h3>Set provider credentials</h3>
45-
<p>NeoCode reads API keys from environment variables instead of storing them in config files.</p>
46-
<CodePanel language="bash" label="Shell" :code="envUnix" />
47-
<CodePanel language="powershell" label="PowerShell" :code="envWindows" />
48-
<div class="quickstart-links">
49-
<p>Workspace isolation: <code>--workdir</code></p>
50-
<p>Gateway command: <code>neocode gateway</code></p>
51-
<p><a href="/neo-code/guide/quick-start">Chinese quick start</a></p>
52-
<p><a href="/neo-code/en/docs/">English docs index</a></p>
53-
</div>
54-
</article>
55-
</div>
30+
const quickStartCards: Record<'zh' | 'en', QuickStartCard[]> = {
31+
zh: [
32+
{
33+
key: 'install',
34+
kicker: '安装脚本',
35+
title: '安装 NeoCode',
36+
description: '直接使用仓库里维护的安装脚本,适合先把本地环境跑起来。',
37+
panels: [
38+
{ language: 'bash', label: 'macOS / Linux', code: installUnix },
39+
{ language: 'powershell', label: 'Windows PowerShell', code: installWindows },
40+
],
41+
links: [{ text: '安装完成后运行:', code: 'neocode' }],
42+
},
43+
{
44+
key: 'source',
45+
kicker: '源码运行',
46+
title: '从源码运行',
47+
description: '准备调试、看源码或参与开发时,直接运行当前仓库即可。',
48+
panels: [{ language: 'bash', label: 'Clone and run', code: fromSource }],
49+
links: [
50+
{ text: '网关进程:', code: 'go run ./cmd/neocode gateway' },
51+
{ text: '会话工作区:', code: '--workdir /path/to/workspace' },
52+
],
53+
},
54+
],
55+
en: [
56+
{
57+
key: 'install',
58+
kicker: 'Install',
59+
title: 'Install with one command',
60+
description: 'Use the same install scripts maintained in the repository README.',
61+
panels: [
62+
{ language: 'bash', label: 'macOS / Linux', code: installUnix },
63+
{ language: 'powershell', label: 'Windows PowerShell', code: installWindows },
64+
],
65+
links: [{ text: 'Then run: ', code: 'neocode' }],
66+
},
67+
{
68+
key: 'source',
69+
kicker: 'Source',
70+
title: 'Run the current codebase',
71+
description: 'Best when you want to inspect behavior, debug issues, or contribute changes.',
72+
panels: [{ language: 'bash', label: 'Clone and run', code: fromSource }],
73+
links: [
74+
{ text: 'Gateway command: ', code: 'go run ./cmd/neocode gateway' },
75+
{ text: 'Workspace isolation: ', code: '--workdir /path/to/workspace' },
76+
],
77+
},
78+
],
79+
}
5680
57-
<div class="quickstart-grid" v-else>
58-
<article class="quickstart-card">
59-
<p class="quickstart-kicker">Step 1</p>
60-
<h3>安装 NeoCode</h3>
61-
<p>直接使用仓库里维护的安装脚本,适合先把本地环境跑起来。</p>
62-
<CodePanel language="bash" label="macOS / Linux" :code="installUnix" />
63-
<CodePanel language="powershell" label="Windows PowerShell" :code="installWindows" />
64-
</article>
65-
66-
<article class="quickstart-card">
67-
<p class="quickstart-kicker">Step 2</p>
68-
<h3>从源码运行</h3>
69-
<p>准备调试、看源码或参与开发时,直接运行当前仓库即可。</p>
70-
<CodePanel language="bash" label="Clone and run" :code="fromSource" />
71-
<div class="quickstart-links">
72-
<p>会话工作区:<code>--workdir /path/to/workspace</code></p>
73-
<p>网关进程:<code>go run ./cmd/neocode gateway</code></p>
74-
</div>
75-
</article>
81+
const currentLocale = computed<'zh' | 'en'>(() => (props.locale === 'en' ? 'en' : 'zh'))
82+
const currentCards = computed(() => quickStartCards[currentLocale.value])
83+
</script>
7684

77-
<article class="quickstart-card">
78-
<p class="quickstart-kicker">Step 3</p>
79-
<h3>配置 API Key</h3>
80-
<p>当前内置 provider 包括 <code>openai</code>、<code>gemini</code>、<code>openll</code> 和 <code>qiniu</code>。</p>
81-
<CodePanel language="bash" label="Shell" :code="envUnix" />
82-
<CodePanel language="powershell" label="PowerShell" :code="envWindows" />
83-
<div class="quickstart-links">
84-
<p>工作区隔离:<code>--workdir</code></p>
85-
<p>网关命令:<code>neocode gateway</code></p>
86-
<p><a href="/neo-code/guide/quick-start">继续看首次上手</a></p>
87-
<p><a href="/neo-code/guide/gateway">查看 Gateway 用法</a></p>
88-
</div>
89-
</article>
90-
</div>
85+
<template>
86+
<div class="quickstart-grid">
87+
<article v-for="card in currentCards" :key="card.key" class="quickstart-card">
88+
<p class="quickstart-kicker">{{ card.kicker }}</p>
89+
<h3>{{ card.title }}</h3>
90+
<p>{{ card.description }}</p>
91+
<CodePanel
92+
v-for="panel in card.panels"
93+
:key="`${card.key}-${panel.label}`"
94+
:language="panel.language"
95+
:label="panel.label"
96+
:code="panel.code"
97+
/>
98+
<div class="quickstart-links">
99+
<p v-for="link in card.links" :key="`${card.key}-${link.code}`">
100+
{{ link.text }}<code>{{ link.code }}</code>
101+
</p>
102+
</div>
103+
</article>
104+
</div>
91105
</template>

www/.vitepress/theme/custom.css

Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -235,27 +235,23 @@ body {
235235
text-underline-offset: 0.14em;
236236
}
237237

238-
.VPDoc div[class*='language-'],
239-
.vp-code-group {
238+
:is(.VPDoc div[class*='language-'], .vp-code-group) {
240239
border: 1px solid rgba(253, 165, 128, 0.16);
241240
box-shadow: 0 16px 36px rgba(9, 11, 26, 0.1);
242241
}
243242

244-
.VPDoc div[class*='language-'] .vp-copy-code-button,
245-
.vp-code-group .vp-copy-code-button {
243+
:is(.VPDoc div[class*='language-'], .vp-code-group) .vp-copy-code-button {
246244
border: none;
247245
border-radius: 999px;
248246
background-color: rgba(253, 165, 128, 0.9);
249247
}
250248

251-
.dark .VPDoc div[class*='language-'],
252-
.dark .vp-code-group {
249+
.dark :is(.VPDoc div[class*='language-'], .vp-code-group) {
253250
border-color: rgba(253, 165, 128, 0.16);
254251
box-shadow: 0 18px 38px rgba(0, 0, 0, 0.28);
255252
}
256253

257-
.dark .VPDoc div[class*='language-'] .vp-copy-code-button,
258-
.dark .vp-code-group .vp-copy-code-button {
254+
.dark :is(.VPDoc div[class*='language-'], .vp-code-group) .vp-copy-code-button {
259255
background-color: rgba(253, 165, 128, 0.24);
260256
}
261257

@@ -321,13 +317,11 @@ body {
321317
}
322318

323319
.quickstart-grid {
324-
grid-template-columns: repeat(3, minmax(0, 1fr));
320+
grid-template-columns: repeat(2, minmax(0, 1fr));
325321
align-items: stretch;
326322
}
327323

328-
.info-grid > *,
329-
.doc-grid > *,
330-
.quickstart-grid > * {
324+
:is(.info-grid, .doc-grid, .quickstart-grid) > * {
331325
min-width: 0;
332326
}
333327

@@ -342,8 +336,7 @@ body {
342336
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 16px 38px rgba(0, 0, 0, 0.2);
343337
}
344338

345-
.info-card h3,
346-
.quickstart-card h3 {
339+
:is(.info-card, .quickstart-card) h3 {
347340
margin-top: 0;
348341
margin-bottom: 10px;
349342
color: #fff4ea;
@@ -402,9 +395,7 @@ body {
402395
font-size: 17px;
403396
}
404397

405-
.doc-card code,
406-
.quickstart-card code,
407-
.info-card code {
398+
:is(.doc-card, .quickstart-card, .info-card) code {
408399
color: #ffd0ba;
409400
background: rgba(253, 165, 128, 0.12);
410401
}
@@ -503,7 +494,6 @@ body {
503494
grid-template-columns: repeat(2, minmax(0, 1fr));
504495
}
505496

506-
.quickstart-grid .quickstart-card:last-child,
507497
.doc-grid .doc-card:last-child {
508498
grid-column: 1 / -1;
509499
}
@@ -529,7 +519,6 @@ body {
529519
grid-template-columns: 1fr;
530520
}
531521

532-
.quickstart-grid .quickstart-card:last-child,
533522
.doc-grid .doc-card:last-child {
534523
grid-column: auto;
535524
}

www/en/docs/index.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,30 @@ description: A compact English entrypoint that links to the primary Chinese guid
55

66
# Docs Index
77

8-
The Chinese guide is the primary documentation set for NeoCode right now. This page stays short on purpose and only links to the most useful entry points.
8+
The Chinese guide is the primary documentation set for NeoCode right now. This page links to the most useful entry points.
99

1010
## Start Here
1111

12+
If you are new to NeoCode, read in this order:
13+
14+
1. [What is NeoCode](/guide/getting-started) (Chinese)
15+
2. [Install and run](/guide/install) (Chinese)
16+
3. [Quick start](/guide/quick-start) (Chinese)
17+
4. [Configuration](/guide/configuration) (Chinese)
18+
5. [Gateway and URL dispatch](/guide/gateway) (Chinese)
19+
20+
## Direct Links
21+
1222
- [Chinese guide overview](/guide/)
1323
- [Install and run](/guide/install)
1424
- [Quick start](/guide/quick-start)
1525
- [Configuration](/guide/configuration)
26+
- [Workspace and sessions](/guide/workspace-session)
27+
- [Memory and Skills](/guide/memo-skills)
1628
- [Gateway and URL dispatch](/guide/gateway)
29+
- [Update and version check](/guide/update)
1730

18-
## Repository Docs
31+
## Reference
1932

2033
- [Reference index](/reference/)
2134
- [README](https://github.com/1024XEngineer/neo-code/blob/main/README.md)

www/en/index.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ features:
2525
- title: Terminal-native
2626
details: TUI interface. No browser needed. Works directly inside your shell workflow.
2727
- title: Multi-model support
28-
details: One config file manages OpenAI, Gemini, Ollama, and more. Switch between models without changing code.
28+
details: Built-in support for OpenAI, Gemini, OpenLL, Qiniu and more. Switch between models without changing code.
2929
---
3030

3131
<section class="home-section compact">
@@ -42,6 +42,10 @@ features:
4242
<strong>English docs index</strong>
4343
<span>A short overview with links into the Chinese guide and repository docs.</span>
4444
</a>
45+
<a class="doc-card" href="/neo-code/guide/install">
46+
<strong>Set credentials</strong>
47+
<span>Configure <code>OPENAI_API_KEY</code>, <code>GEMINI_API_KEY</code>, and other provider API keys.</span>
48+
</a>
4549
<a class="doc-card" href="/neo-code/guide/">
4650
<strong>Chinese guide</strong>
4751
<span>The primary user guide covering install, quick start, configuration, sessions, memo, skills, and Gateway usage.</span>

www/guide/install.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,17 @@ curl -fsSL https://raw.githubusercontent.com/1024XEngineer/neo-code/main/scripts
2424
irm https://raw.githubusercontent.com/1024XEngineer/neo-code/main/scripts/install.ps1 | iex
2525
```
2626

27+
安装脚本会自动从 GitHub Releases 下载最新稳定版二进制文件:
28+
29+
- macOS / Linux:下载并解压到 `/usr/local/bin/`(可能需要 `sudo` 权限)
30+
- Windows:下载并解压到 `%LOCALAPPDATA%\NeoCode`,同时更新用户 `PATH`
31+
32+
安装完成后,在终端直接运行:
33+
34+
```bash
35+
neocode
36+
```
37+
2738
## 从源码运行
2839

2940
```bash

www/guide/memo-skills.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,41 @@ Skills 不会改变:
5050
- 每个 Skill 目录要求存在 `SKILL.md`
5151
- 也支持 root 目录直接放一个 `SKILL.md`
5252

53+
### 仓库内置 Skills
54+
55+
NeoCode 仓库本身也维护了一套 Skills,位于:
56+
57+
```text
58+
.agents/skills/
59+
```
60+
61+
包含三类:
62+
63+
- `issue-rfc-proposal` — 提案类 Issue(RFC 风格)
64+
- `issue-rfc-architecture` — 架构类 Issue(RFC 风格)
65+
- `issue-rfc-implementation` — 实现类 Issue(执行单风格)
66+
67+
可以通过 `make` 一键安装到常用 AI 工具目录:
68+
69+
```bash
70+
make install-skills
71+
```
72+
73+
默认会安装到以下位置:
74+
75+
```text
76+
.codex/skills
77+
.claude/skills
78+
.cursor/skills
79+
.windsurf/skills
80+
```
81+
82+
如果需要自定义目标,设置 `SKILL_INSTALL_TARGETS`
83+
84+
```bash
85+
SKILL_INSTALL_TARGETS=".codex/skills:.claude/skills" make install-skills
86+
```
87+
5388
## 会话内 Skills 命令
5489

5590
```text

www/guide/quick-start.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,3 +75,4 @@ go run ./cmd/neocode
7575
- 想了解配置文件和自定义 Provider:看 [配置入口](./configuration)
7676
- 想理解工作区、会话切换和压缩:看 [工作区与会话](./workspace-session)
7777
- 想启用记忆和 Skills:看 [记忆与 Skills](./memo-skills)
78+
- 想手动升级或了解静默版本检测:看 [升级与版本检查](./update)

www/index.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ features:
2525
- title: 终端原生
2626
details: TUI 界面,无需浏览器,和你的 shell 工作流无缝集成,直接在终端中对话和操作。
2727
- title: 多模型支持
28-
details: 一份配置管理 OpenAI、Gemini、Ollama 等多个模型服务,随时切换,无需改代码。
28+
details: 内置 OpenAI、Gemini、OpenLL、Qiniu 等多个模型服务,通过配置随时切换,无需改代码。
2929
---
3030

3131
<section class="home-section compact">
@@ -46,6 +46,10 @@ features:
4646
<strong>首次上手</strong>
4747
<span>第一次提问、常用 Slash 命令和 Provider / Model 切换。</span>
4848
</a>
49+
<a class="doc-card" href="/neo-code/guide/install">
50+
<strong>配置环境变量</strong>
51+
<span>设置 <code>OPENAI_API_KEY</code>、<code>GEMINI_API_KEY</code> 等 API Key 环境变量。</span>
52+
</a>
4953
<a class="doc-card" href="/neo-code/guide/configuration">
5054
<strong>配置</strong>
5155
<span><code>config.yaml</code>、custom provider 和环境变量。</span>

0 commit comments

Comments
 (0)