Skip to content

Commit ec3a174

Browse files
CC11001100claude
andcommitted
feat(website): 迁移官网至 VitePress,新增算法详解与 Mermaid 可视化
- 将原 React 站点备份至 website-react-legacy/,website/ 改用 VitePress - 新增 11 个 Markdown 页面:首页(含一键复制 AI 提示词)、why、how-it-works、 algorithms(7 节算法详解)、ai-agents、prompts、quick-start、sdk、cli、mcp、skills - 接入 vitepress-plugin-mermaid,全站 10 张流程图/架构图/决策树 - 首页 AI-first:code-group 覆盖 Claude Code/Codex/Cursor/Windsurf/VS Code/Cline - 更新 deploy-website.yml 适配 VitePress 输出路径(.vitepress/dist) - README 新增中英双语算法详解章节 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 2a189fe commit ec3a174

45 files changed

Lines changed: 7656 additions & 1613 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/deploy-website.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
- name: Upload artifact
4747
uses: actions/upload-pages-artifact@v5
4848
with:
49-
path: website/dist
49+
path: website/.vitepress/dist
5050

5151
deploy:
5252
name: Deploy to GitHub Pages

README.md

Lines changed: 460 additions & 12 deletions
Large diffs are not rendered by default.

website-react-legacy/.gitignore

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
dist
12+
dist-ssr
13+
*.local
14+
15+
# Editor directories and files
16+
.vscode/*
17+
!.vscode/extensions.json
18+
.idea
19+
.DS_Store
20+
*.suo
21+
*.ntvs*
22+
*.njsproj
23+
*.sln
24+
*.sw?

website-react-legacy/README.md

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# Versions-Skills Website
2+
3+
The marketing & documentation site for [versions-skills](https://github.com/scagogogo/versions-skills) — an AI-native version-number toolkit (Skills + MCP + Go SDK + CLI).
4+
5+
Deployed at **https://scagogogo.github.io/versions-skills/** via GitHub Pages (build artifacts committed under `dist/` and published by a GitHub Action).
6+
7+
## Stack
8+
9+
- **React 19** + **TypeScript 6** + **Vite 8** (Rolldown bundler)
10+
- **Ant Design 6** component library
11+
- **react-router-dom 7** (single-page, `basename="/versions-skills"`)
12+
- **oxlint** for linting
13+
- Flat in-house design system (blue-gray palette) — see `src/index.css`
14+
15+
## Project Structure
16+
17+
```
18+
website/
19+
├── src/
20+
│ ├── App.tsx # Router, single HomePage route
21+
│ ├── main.tsx # Entry point
22+
│ ├── index.css # Design tokens + shared classes (.section-title, .flat-card …)
23+
│ ├── pages/
24+
│ │ └── HomePage.tsx # Section composition
25+
│ └── components/
26+
│ ├── SiteHeader.tsx # Sticky nav + GitHub button
27+
│ ├── HeroSection.tsx # Hero banner
28+
│ ├── FeaturesSection.tsx # 12 core capabilities grid
29+
│ ├── AlgorithmsSection.tsx # ★ Algorithm deep-dive (parse / compare / suffix weight / constraints / range / sort+group)
30+
│ ├── ArchitectureSection.tsx # 4-layer architecture diagram + 13 skills
31+
│ ├── AccessSection.tsx # 4 access methods (Skills / SDK / CLI / MCP)
32+
│ ├── CasesSection.tsx # Use cases
33+
│ ├── TutorialsSection.tsx
34+
│ ├── AiIntegrationSection.tsx # Per-agent MCP config (Claude Code / Codex / Cursor / Windsurf / Cline / VS Code)
35+
│ ├── QuickStartSection.tsx
36+
│ └── SiteFooter.tsx
37+
├── public/
38+
│ └── favicon.svg
39+
├── index.html
40+
└── vite.config.ts # base: '/versions-skills/'
41+
```
42+
43+
The page is composed of vertical sections, each with an `id` used as a hash anchor by the header nav: `#features`, `#algorithms`, `#access`, `#cases`, `#tutorials`, `#ai-integration`, `#quickstart`.
44+
45+
## Development
46+
47+
```bash
48+
# from the website/ directory
49+
npm install # first time only
50+
npm run dev # Vite dev server with HMR → http://localhost:5173
51+
npm run build # type-check (tsc -b) + production build → dist/
52+
npm run preview # serve the production build locally
53+
npm run lint # oxlint
54+
```
55+
56+
> The dev server runs at a root path, but the production build uses `base: '/versions-skills/'` so assets resolve under the GitHub Pages subpath. Internal links go through `react-router` with `basename="/versions-skills"`.
57+
58+
## Editing Content
59+
60+
All copy lives in the section components under `src/components/` — there is no CMS. To change wording, edit the relevant `*Section.tsx` and its data arrays (e.g. `features`, `aiClients`, `suffixWeights`). The algorithm tables in `AlgorithmsSection.tsx` mirror the Go source in the repo root (`parser.go`, `version.go`, `suffix_weight.go`, `constraint.go`, `version_range.go`, `sort.go`) — keep them in sync when the Go semantics change.
61+
62+
## Design Notes
63+
64+
- **Flat design** — no shadows, no gradients; `1px solid #e2e8f0` borders, `4px` radius.
65+
- Palette is CSS custom properties in `src/index.css` (`--c-primary``--c-gray-900`).
66+
- Code blocks use the dark slate theme (`background: #1e293b; color: #e2e8f0`).
67+
- Shared classes: `.section-title` (32px / 700), `.section-subtitle` (16px / gray-500), `.flat-card` (hover lifts border to gray-300).
68+
69+
## CI / Deployment
70+
71+
Pushing to `main` triggers the Pages workflow, which runs `npm run build` and uploads `dist/`. See `.github/workflows/` in the repo root.

0 commit comments

Comments
 (0)