Appearance
Markdown Online Preview Site Plan
Goal
Build a lightweight online preview site for Markdown files generated by Codex.
Instead of sending long Markdown content through WeChat, Codex should be able to:
- Generate a
.mdfile locally. - Put it into a preview-site repository or folder.
- Trigger deployment.
- Return a public preview URL.
Example final URL:
text
https://docs.lshbosheth.cn/ranran-gsap-migrationFinal Direction
Use a small dedicated documentation site.
Final stack:
- VitePress
- Vercel
- Custom subdomain
- Git-backed deployment
Suggested subdomains:
text
docs.lshbosheth.cn
preview.lshbosheth.cn
notes.lshbosheth.cnRecommended final domain:
text
docs.lshbosheth.cnThe preview site should be treated as a real output channel for Codex-generated documents, not as a temporary static folder.
Final Architecture
text
Codex workspace
↓ generate markdown
docs-preview repository
↓ git push
Vercel deployment
↓ custom domain
https://docs.lshbosheth.cn/{slug}The user should receive the final preview URL instead of the full Markdown body in WeChat.
VitePress Setup
Project Structure
text
docs-preview/
package.json
docs/
index.md
ranran-gsap-migration.md
markdown-preview-site-plan.md
.vitepress/
config.tsBasic Setup
bash
npm create vitepress@latest docs-preview
cd docs-preview
npm install
npm run docs:devOr manually install:
bash
npm init -y
npm install -D vitepressExample package.json scripts:
json
{
"scripts": {
"docs:dev": "vitepress dev docs",
"docs:build": "vitepress build docs",
"docs:preview": "vitepress preview docs"
},
"devDependencies": {
"vitepress": "latest"
}
}Example VitePress Config
docs/.vitepress/config.ts
ts
import { defineConfig } from "vitepress";
export default defineConfig({
title: "lshbosheth Docs",
description: "Markdown previews generated by Codex",
cleanUrls: true,
themeConfig: {
nav: [
{ text: "Home", link: "/" }
],
sidebar: [
{
text: "Preview Docs",
items: [
{ text: "Ranran GSAP Migration", link: "/ranran-gsap-migration" },
{ text: "Markdown Preview Site Plan", link: "/markdown-preview-site-plan" }
]
}
]
}
});Deployment
Deploy to Vercel or Cloudflare Pages.
For Vercel:
- Framework preset:
VitePressorOther - Build command:
bash
npm run docs:build- Output directory:
text
docs/.vitepress/distBind a custom domain such as:
text
docs.lshbosheth.cnRepository
text
docs-previewThis should be a separate repository from the WeChat bridge workspace.
Suggested repo location:
text
github.com/lshbosheth/docs-previewSuggested local checkout path:
text
D:\lshbosheth\cc-connect-weixin-codex\workspace\docs-previewThis path keeps the preview repository visible to Codex in the current workspace, while still allowing it to be its own Git repository.
If nested Git repositories become inconvenient, move it to:
text
D:\lshbosheth\docs-previewand record the final path in lshbosheth-memory.
Recommended content folder:
text
docs-preview/docs/Generated Markdown files should be copied or created directly into:
text
docs-preview/docs/{slug}.mdThen the preview URL should be:
text
https://docs.lshbosheth.cn/{slug}Publishing Rules
Do not publish every Markdown file automatically.
Use these rules:
- If the user says
写一个 md 放工作区, save it locally only. - If the user says
生成 md 并给我预览链接, publish it to the preview site. - If the user says
这个也发线上预览, publish it to the preview site. - If the document may contain private health, account, company, or project secrets, ask before publishing or keep it local.
Default behavior:
text
Local md only, unless the user asks for an online preview link.Deployment Flow
One-time setup
- Create
docs-previewrepository. - Initialize VitePress.
- Push to GitHub.
- Import the repository into Vercel.
- Set build command:
bash
npm run docs:build- Set output directory:
text
docs/.vitepress/dist- Bind custom domain:
text
docs.lshbosheth.cn- Confirm Vercel auto-deploys on
mainbranch push.
Per-document flow
- Codex creates or updates
docs/{slug}.md. - Codex updates
docs/.vitepress/config.tssidebar when the doc should appear in navigation. - Codex runs the local build if practical.
- Codex commits and pushes.
- Vercel deploys automatically.
- Codex replies with:
text
https://docs.lshbosheth.cn/{slug}Future Codex Workflow
When the user asks Codex to generate a document:
- Create the Markdown file.
- Generate a safe slug from the title.
- Save it to the preview site.
- Update sidebar/navigation if needed.
- Run build locally if useful.
- Commit and push to the preview-site repo.
- Wait for deployment or trigger deployment.
- Return only the preview URL in WeChat.
Example:
text
User: 写一个 ranran GSAP 迁移说明,给我线上预览。
Codex:
- Creates docs/ranran-gsap-migration.md
- Updates sidebar
- Deploys preview site
- Replies:
https://docs.lshbosheth.cn/ranran-gsap-migrationNaming Rules
Use lowercase kebab-case slugs.
Examples:
text
ranran-gsap-migration
markdown-preview-site-plan
macbook-air-vs-pro
wechat-codex-bridge-notesAvoid Chinese filenames for public URLs unless there is a specific reason.
Privacy Notes
Do not publish private notes by default.
Before publishing, check whether the Markdown contains:
- Tokens or API keys.
- Private domains or internal URLs.
- Phone numbers or addresses.
- Account names that should not be public.
- Personal health details.
- Work-internal implementation details.
If the content is private, either:
- Keep it local only.
- Publish to a private repo / protected site.
- Redact sensitive sections before deployment.
Acceptance Criteria
The first version is ready when:
- A Markdown file can be added locally.
- The file has a stable public preview URL.
- The site works on desktop and mobile.
- The custom domain resolves correctly.
- Codex can update the docs without pasting long content into WeChat.
Notes
This preview site should be separate from the main cc-connect-weixin-codex workspace unless there is a strong reason to couple them.
The preview site is an output channel, not the source of long-term memory.
Docsify is intentionally not used in the final plan. VitePress is preferred because this preview site may become a long-term document surface with navigation, clean URLs, custom theme control, and stable deployment behavior.