feat: initialize VitePress CMS

This commit is contained in:
Coldsmile_7
2026-06-05 23:21:41 +08:00
commit 928f742d5e
45 changed files with 8214 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
import { defineConfig } from "vitepress";
export default defineConfig({
title: "VitePress CMS Test",
description: "A local VitePress site used by VitePress-CMS for integration tests.",
lastUpdated: true,
themeConfig: {
logo: "/logo.svg",
nav: [
{ text: "首页", link: "/" },
{ text: "指南", link: "/guide/getting-started" },
{ text: "配置", link: "/guide/config" },
{ text: "更新日志", link: "/changelog" },
],
sidebar: {
"/guide/": [
{
text: "指南",
items: [
{ text: "快速开始", link: "/guide/getting-started" },
{ text: "页面管理", link: "/guide/pages" },
{ text: "配置说明", link: "/guide/config" },
],
},
],
},
socialLinks: [
{ icon: "github", link: "https://github.com/example/vitepress-cms" },
],
footer: {
message: "Powered by VitePress-CMS",
copyright: "Copyright 2026",
},
search: {
provider: "local",
},
},
});

24
test-vitepress/README.md Normal file
View File

@@ -0,0 +1,24 @@
# VitePress CMS Test Site
这是一个独立的 VitePress 测试站点,用来模拟真实用户项目。
VitePress-CMS 主项目不依赖 VitePress。后续 CMS 会通过文件系统或 GitHub API 读取这个站点的 Markdown 页面和 `.vitepress/config.ts`
## 本地运行
```bash
npm install
npm run dev
```
默认开发地址:
```text
http://localhost:5175
```
## 构建
```bash
npm run build
```

View File

@@ -0,0 +1,12 @@
---
title: 更新日志
description: 测试站点更新记录
---
# 更新日志
## v0.1.0
- 创建 VitePress 测试站点
- 添加导航栏、侧边栏和多篇 Markdown 页面
- 准备给 VitePress-CMS 做本地读取测试

View File

@@ -0,0 +1,18 @@
---
title: 配置说明
description: 测试 VitePress 配置解析
---
# 配置说明
这个页面用于测试 `.vitepress/config.ts` 的读取与回写。
## 第一版优先支持
- `title`
- `description`
- `themeConfig.logo`
- `themeConfig.nav`
- `themeConfig.sidebar`
- `themeConfig.socialLinks`
- `themeConfig.search`

View File

@@ -0,0 +1,17 @@
---
title: 快速开始
description: 测试站点的快速开始页面
---
# 快速开始
这个页面用于测试 VitePress-CMS 的 Markdown 编辑体验。
## 编辑流程
1. CMS 读取这个文件。
2. 用户在后台修改标题、描述和正文。
3. CMS 将修改保存回 Markdown 文件。
4. VitePress 重新构建站点。
> 这条链路跑通后,项目就从界面原型进入真实可用阶段。

View File

@@ -0,0 +1,20 @@
---
title: 页面管理
description: 测试页面目录、搜索和新增页面
---
# 页面管理
这个页面用于测试页面树和文件路径管理。
## 需要覆盖的场景
- 读取嵌套目录
- 新建 Markdown 页面
- 重命名页面
- 删除页面
- 移动页面位置
## 文件路径
当前文件路径是 `test-vitepress/guide/pages.md`

20
test-vitepress/index.md Normal file
View File

@@ -0,0 +1,20 @@
---
title: 首页
description: VitePress-CMS 测试站点首页
---
# VitePress CMS Test
这是一个给 VitePress-CMS 使用的本地测试站点。
它用来验证这些能力:
- 扫描 Markdown 页面
- 解析 frontmatter
- 读取和修改 `.vitepress/config.ts`
- 管理导航栏和侧边栏
- 构建真实 VitePress 站点
## 测试入口
从 [快速开始](/guide/getting-started) 开始查看测试内容。

2552
test-vitepress/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,15 @@
{
"name": "vitepress-cms-test-site",
"version": "0.1.0",
"private": true,
"type": "module",
"description": "A standalone VitePress site used to test VitePress-CMS integrations.",
"scripts": {
"dev": "vitepress dev . --host 0.0.0.0 --port 5175",
"build": "vitepress build .",
"preview": "vitepress preview . --host 0.0.0.0 --port 5176"
},
"devDependencies": {
"vitepress": "^1.6.0"
}
}

View File

@@ -0,0 +1,4 @@
<svg width="64" height="64" viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="VC">
<rect width="64" height="64" rx="12" fill="#117a72"/>
<path d="M14 18h9l9 26 9-26h9L36 50h-8L14 18Z" fill="#fff"/>
</svg>

After

Width:  |  Height:  |  Size: 237 B