Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 14 additions & 45 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,61 +6,30 @@ on:
- "v*"
workflow_dispatch:

# Set GITHUB_TOKEN permissions to allow deployment to GitHub Pages
permissions:
contents: write
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs between the currently running and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
# Only one publish at a time; never cancel an in-flight production deploy.
concurrency:
group: pages
group: scalar-docs
cancel-in-progress: false

jobs:
build-and-deploy:
publish:
runs-on: ubuntu-latest

steps:
- name: Checkout main
uses: actions/checkout@v4
with:
ref: main
fetch-depth: 0 # Not needed if lastUpdated is not enabled


- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 10

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV

- name: Setup pnpm cache
uses: actions/cache@v4
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Build with VitePress
run: pnpm build

- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/.vitepress/dist
cname: docs.memoh.ai
node-version: 24

- name: Validate scalar.config.json
run: npx @scalar/cli@latest project check-config

- name: Publish to Scalar
env:
SCALAR_API_KEY: ${{ secrets.SCALAR_API_KEY }}
run: npx @scalar/cli@latest project publish
30 changes: 30 additions & 0 deletions .github/workflows/validate-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Validate Docs

on:
push:
branches:
- main
paths:
- "scalar.config.json"
- "docs/**"
pull_request:
paths:
- "scalar.config.json"
- "docs/**"

jobs:
validate:
name: Validate scalar.config.json
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 24

- name: Validate
run: npx @scalar/cli@latest project check-config
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,6 @@ dist-ssr
*.sln
*.sw?

.vitepress/cache

# Scalar CLI
.scalar
76 changes: 31 additions & 45 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

This repository contains the public documentation site for [Memoh](https://github.com/felinics/Memoh), a multi-member, long-memory AI agent platform with isolated workspaces, channel integrations, and desktop/server deployment modes.

The product source code lives in [`felinics/Memoh`](https://github.com/felinics/Memoh). This repository only owns the docs site: VitePress config, Markdown pages, and screenshots.
The product source code lives in [`felinics/Memoh`](https://github.com/felinics/Memoh). This repository only owns the docs site: the Scalar Docs config, Markdown/MDX pages, and screenshots.

## What Is Here

Expand All @@ -27,11 +27,11 @@ The product source code lives in [`felinics/Memoh`](https://github.com/felinics/
- **Self-hosted** docs for Desktop, Server Deploy, workspace backends, Kata, and SQLite.
- **English and Chinese docs** under `docs/` and `docs/zh/`.
- **Static assets** under `docs/public/`, including screenshots and logos.
- **VitePress config** under `docs/.vitepress/`.
- **Scalar Docs config** in `scalar.config.json` at the repository root.

## Documentation Structure

The current VitePress site is organized around three primary navigation roots:
The site is organized around three primary navigation roots:

- `docs/guides/` for product usage guides.
- `docs/integrations/` for channels, providers, memory providers, TTS, and web search.
Expand All @@ -43,84 +43,70 @@ The Simplified Chinese mirror uses the same structure under `docs/zh/`:
- `docs/zh/integrations/`
- `docs/zh/self-hosted/`

Legacy paths still exist for old external links, but they are redirect pages instead of the main content source:
Both languages are wired up as Scalar **versions** in `scalar.config.json`. The `default` version serves English at `/*`, the `zh` version serves Simplified Chinese at `/zh/*`, and Scalar renders the language switcher in the header. Inside the `zh` version, route keys are written *without* the `/zh` prefix — Scalar adds it.

- `docs/getting-started/`
- `docs/installation/`
- `docs/channels/`
- `docs/tts-providers/`
- `docs/memory-providers/`
- Matching Chinese redirects under `docs/zh/`
Legacy paths from the previous information architecture (`/getting-started/*`, `/installation/*`, `/channels/*`, `/tts-providers/*`, `/memory-providers/*`, and their `/zh/` counterparts) are kept alive as `siteConfig.routing.redirects` entries in `scalar.config.json`. There are no redirect pages in `docs/` anymore — when a redirect target moves, edit the config.

When updating content, edit the primary paths above first. Only touch a legacy redirect page when the redirect target itself changes.

Keep the English and Simplified Chinese docs mirrored. If you add, rename, remove, or move a page in one language, make the matching change in the other language and update both VitePress sidebar files.

Do not edit `docs/.vitepress/dist/` by hand. It is generated build output and should not be treated as source documentation.
Keep the English and Simplified Chinese docs mirrored. If you add, rename, remove, or move a page in one language, make the matching change in the other language and update both versions in `scalar.config.json`.

## Local Development

Use Node.js and pnpm. The repository is a standalone VitePress project.
The Scalar CLI needs no install step:

```bash
pnpm install
pnpm dev
npx @scalar/cli project preview
```

The dev server runs at:

```text
http://localhost:5173
http://localhost:7970
```

## Build

```bash
pnpm build
```
## Validate

Preview the production build:
`scalar.config.json` is the single source of truth for the sitemap and sidebar, and CI validates it on every push and pull request that touches `scalar.config.json` or `docs/**`:

```bash
pnpm preview
npx @scalar/cli project check-config
```

## Project Layout

```text
.
├── docs/
│ ├── .vitepress/ # VitePress config, nav, sidebars
│ ├── guides/ # Product usage guides
│ ├── integrations/ # Channels and providers
│ ├── self-hosted/ # Open-source deployment docs
│ ├── getting-started/ # Legacy redirects to guides
│ ├── installation/ # Legacy redirects to self-hosted
│ ├── channels/ # Legacy redirects to integrations/channels
│ ├── tts-providers/ # Legacy redirects to integrations/providers/tts
│ ├── memory-providers/ # Legacy redirects to integrations/providers/memory
│ ├── public/ # Static images and logo
│ ├── zh/ # Simplified Chinese documentation and redirects
│ └── *.md # Landing and compatibility pages
├── package.json
└── pnpm-lock.yaml
│ ├── public/ # Static images and logo (served from the site root)
│ ├── zh/ # Simplified Chinese documentation
│ ├── footer.html # Site footer
│ └── index.mdx # Landing page
├── scalar.config.json # Navigation, routing, theme, redirects
└── package.json
```

Pages are plain Markdown by default. Use the `.mdx` extension when a page needs [Scalar components](https://scalar.com/products/docs) such as `Callout` or `PageLink`, and import them at the top of the file:

```mdx
import { Callout } from 'scalar-mdx-components'

<Callout type="warning">
Something to be careful about.
</Callout>
```

## Contributing

Small fixes are best made directly in the relevant Markdown page. For larger changes:

1. Run `pnpm dev`.
1. Run `npx @scalar/cli project preview`.
2. Edit the docs under `docs/`.
3. Run `pnpm build`.
3. Run `npx @scalar/cli project check-config`.
4. Open a pull request with screenshots when the change affects layout or images.

When adding a new page, update the matching sidebar file in `docs/.vitepress/`:

- `en.ts` for English pages
- `zh.ts` for Chinese pages

Do not use the legacy redirect folders as the canonical location for new content. New source pages should live under `guides`, `integrations`, or `self-hosted`, with the matching `docs/zh/` page kept in sync.
When adding a new page, add a matching route entry under both versions in `scalar.config.json` — a file with no route entry is not published. New source pages should live under `guides`, `integrations`, or `self-hosted`, with the matching `docs/zh/` page kept in sync.

## License

Expand Down
76 changes: 31 additions & 45 deletions README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

这个仓库保存 [Memoh](https://github.com/felinics/Memoh) 的公开文档。Memoh 是一个多成员、长期记忆的 AI 智能体平台,支持独立 workspace、跨渠道接入,以及桌面版和服务器部署。

产品代码在 [`felinics/Memoh`](https://github.com/felinics/Memoh)。这个仓库只负责文档站:VitePress 配置、Markdown 页面和截图。
产品代码在 [`felinics/Memoh`](https://github.com/felinics/Memoh)。这个仓库只负责文档站:Scalar Docs 配置、Markdown/MDX 页面和截图。

## 这里有什么

Expand All @@ -27,11 +27,11 @@
- **自托管**:Desktop、Server Deploy、workspace backend、Kata 和 SQLite 等开源部署文档。
- 英文和中文文档,分别位于 `docs/` 和 `docs/zh/`。
- 截图、logo 等静态资源,位于 `docs/public/`。
- VitePress 配置,位于 `docs/.vitepress/`。
- Scalar Docs 配置,位于仓库根目录的 `scalar.config.json`。

## 文档站结构

当前 VitePress 文档站围绕三个主导航路径组织:
文档站围绕三个主导航路径组织:

- `docs/guides/`:产品使用教程。
- `docs/integrations/`:渠道、提供方、记忆提供方、TTS 和网页搜索。
Expand All @@ -43,84 +43,70 @@
- `docs/zh/integrations/`
- `docs/zh/self-hosted/`

旧路径仍然保留,用于兼容外部旧链接,但它们是重定向页面,不是主要内容源:
两种语言在 `scalar.config.json` 里以 Scalar **version** 的形式配置:`default` 提供英文文档,路径为 `/*`;`zh` 提供简体中文文档,路径为 `/zh/*`;语言切换器由 Scalar 在页头自动渲染。注意 `zh` version 内部的路由 key 不要带 `/zh` 前缀,Scalar 会自动加上。

- `docs/getting-started/`
- `docs/installation/`
- `docs/channels/`
- `docs/tts-providers/`
- `docs/memory-providers/`
- `docs/zh/` 下对应的中文重定向路径
旧信息架构的路径(`/getting-started/*`、`/installation/*`、`/channels/*`、`/tts-providers/*`、`/memory-providers/*` 以及 `/zh/` 下的对应路径)通过 `scalar.config.json` 里的 `siteConfig.routing.redirects` 保持可用。`docs/` 下不再有重定向页面——重定向目标变化时,直接改配置。

更新内容时,请优先修改上面的主路径。只有重定向目标本身变化时,才需要修改 legacy redirect 页面。

英文和简体中文文档需要保持镜像一致。如果在一种语言中新增、重命名、删除或移动页面,请在另一种语言中做对应变更,并同时更新两个 VitePress 侧边栏文件。

不要手动编辑 `docs/.vitepress/dist/`。它是构建生成产物,不应当作为文档源码维护。
英文和简体中文文档需要保持镜像一致。如果在一种语言中新增、重命名、删除或移动页面,请在另一种语言中做对应变更,并同时更新 `scalar.config.json` 里的两个 version。

## 本地开发

需要 Node.js 和 pnpm。这个仓库是独立的 VitePress 项目。
Scalar CLI 无需安装步骤:

```bash
pnpm install
pnpm dev
npx @scalar/cli project preview
```

开发服务器默认运行在:

```text
http://localhost:5173
http://localhost:7970
```

## 构建

```bash
pnpm build
```
## 校验

预览生产构建
`scalar.config.json` 是站点地图和侧边栏的唯一来源。任何改动 `scalar.config.json` 或 `docs/**` 的 push 和 PR,CI 都会校验它

```bash
pnpm preview
npx @scalar/cli project check-config
```

## 目录结构

```text
.
├── docs/
│ ├── .vitepress/ # VitePress 配置、导航、侧边栏
│ ├── guides/ # 产品使用教程
│ ├── integrations/ # 渠道和提供方
│ ├── self-hosted/ # 开源自托管部署文档
│ ├── getting-started/ # 到 guides 的旧路径重定向
│ ├── installation/ # 到 self-hosted 的旧路径重定向
│ ├── channels/ # 到 integrations/channels 的旧路径重定向
│ ├── tts-providers/ # 到 integrations/providers/tts 的旧路径重定向
│ ├── memory-providers/ # 到 integrations/providers/memory 的旧路径重定向
│ ├── public/ # 静态图片和 logo
│ ├── zh/ # 中文文档和重定向页面
│ └── *.md # 入口和兼容页面
├── package.json
└── pnpm-lock.yaml
│ ├── public/ # 静态图片和 logo(从站点根路径提供)
│ ├── zh/ # 中文文档
│ ├── footer.html # 站点页脚
│ └── index.mdx # 落地页
├── scalar.config.json # 导航、路由、主题、重定向
└── package.json
```

页面默认是纯 Markdown。需要用 [Scalar 组件](https://scalar.com/products/docs)(例如 `Callout`、`PageLink`)时,把文件扩展名改成 `.mdx`,并在文件顶部导入:

```mdx
import { Callout } from 'scalar-mdx-components'

<Callout type="warning">
需要注意的内容。
</Callout>
```

## 贡献文档

小的错别字、链接和措辞修正可以直接改对应 Markdown 页面。较大的结构调整建议这样做:

1. 运行 `pnpm dev`。
1. 运行 `npx @scalar/cli project preview`。
2. 修改 `docs/` 下的文档。
3. 运行 `pnpm build`。
3. 运行 `npx @scalar/cli project check-config`。
4. 如果改动影响布局或图片,在 PR 里附上截图。

新增页面时,记得更新对应的侧边栏配置:

- 英文页面:`docs/.vitepress/en.ts`
- 中文页面:`docs/.vitepress/zh.ts`

不要把 legacy redirect 目录作为新内容的规范位置。新的源码页面应放在 `guides`、`integrations` 或 `self-hosted` 下,并同步维护对应的 `docs/zh/` 页面。
新增页面时,记得在 `scalar.config.json` 的两个 version 下都加上对应的路由条目——没有路由条目的文件不会被发布。新的源码页面应放在 `guides`、`integrations` 或 `self-hosted` 下,并同步维护对应的 `docs/zh/` 页面。

## 许可证

Expand Down
Loading
Loading