diff --git a/README.md b/README.md
index ef4b3cbf9..78f8f7cdd 100644
--- a/README.md
+++ b/README.md
@@ -13,12 +13,16 @@
# OpenDirector
+**[Download OpenDirector](https://thinkflowlab.github.io/OpenDirector/#download)** for Apple Silicon Macs and Windows x64 PCs.
+
**From an idea to a downloadable short film: generate through chat, organize on a canvas, edit media, and export from a timeline.**
OpenDirector is an AI video creation workspace that runs locally and is accessed through your browser. Discuss ideas with the assistant and generate assets, organize and iterate on them on the canvas, edit images, video, and audio, then arrange your material on a timeline and export an MP4.
Use it to explore visual ideas, refine assets, and make short films. Projects stay on your machine; generation uses the provider APIs or self-hosted model services you choose.
+[Official website](https://thinkflowlab.github.io/OpenDirector/en/) · [Download for macOS or Windows](https://thinkflowlab.github.io/OpenDirector/en/#download) · [Watch the example film](https://thinkflowlab.github.io/OpenDirector/en/#film) · [Installation guide](docs/guides/installation.md)
+
[News](#news) · [Example film](#example-film-we-can-still-win) · [Quick start](#quick-start) · [Documentation](#documentation) · [Community](#community) · [Contributing](#contributing)
## News
@@ -54,6 +58,10 @@ https://github.com/user-attachments/assets/11babc03-e35c-40e7-b5f6-7d476b6bf11a
## Quick start
+### Install the desktop app
+
+[Download the installer](https://thinkflowlab.github.io/OpenDirector/en/#download) for macOS (Apple Silicon) or Windows (x64). Install and open OpenDirector.
+
### Install with AI
Send this prompt to your AI assistant:
diff --git a/README.zh-CN.md b/README.zh-CN.md
index 091a38d6c..1cb915efc 100644
--- a/README.zh-CN.md
+++ b/README.zh-CN.md
@@ -19,6 +19,8 @@ OpenDirector 是一个在本地运行、通过浏览器使用的 AI 视频创作
适合验证视觉创意、反复调整素材和制作短片。项目保存在本机,生成内容使用你选择的服务商 API 或自部署模型服务。
+[官方网站](https://thinkflowlab.github.io/OpenDirector/zh-cn/) · [下载 macOS 或 Windows 版](https://thinkflowlab.github.io/OpenDirector/zh-cn/#download) · [观看短片示例](https://thinkflowlab.github.io/OpenDirector/zh-cn/#film) · [安装指南](docs/guides/installation.zh-CN.md)
+
[最新动态](#最新动态) · [短片示例](#短片示例我们还能赢) · [快速开始](#快速开始) · [文档](#文档) · [社区交流](#社区交流) · [参与贡献](#参与贡献)
## 最新动态
@@ -54,6 +56,10 @@ https://github.com/user-attachments/assets/11babc03-e35c-40e7-b5f6-7d476b6bf11a
## 快速开始
+### 安装桌面版
+
+[下载 macOS(Apple 芯片)或 Windows(x64)安装包](https://thinkflowlab.github.io/OpenDirector/zh-cn/#download),安装完成后打开 OpenDirector。
+
### 一句话安装
把下面这句话发给你正在使用的 AI:
diff --git a/scripts/build-website.sh b/scripts/build-website.sh
index ebcb2f1ad..499e627dc 100644
--- a/scripts/build-website.sh
+++ b/scripts/build-website.sh
@@ -6,9 +6,10 @@ root=$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)
node --check "$root/website/site.mjs"
node --check "$root/website/ambient.mjs"
+node --check "$root/website/language.mjs"
mkdir -p "$output"
-node "$root/website/build.mjs" "$output/index.html"
-cp "$root"/website/{site.css,showcase.css,ambient.mjs,site.mjs,logo.png} "$output/"
+node "$root/website/build.mjs" "$output"
+cp "$root"/website/{site.css,showcase.css,ambient.mjs,site.mjs,language.mjs,messages.mjs,logo.png} "$output/"
cp "$root/docs/guides/assets/dota2-short-film-canvas.jpg" "$output/canvas.jpg"
mkdir -p "$output/film"
cp "$root"/website/film/*.jpg "$output/film/"
diff --git a/website/README.md b/website/README.md
index 59dedf833..fc94fb790 100644
--- a/website/README.md
+++ b/website/README.md
@@ -12,20 +12,22 @@ bash scripts/build-website.sh "$preview/dist/OpenDirector"
node_modules/.bin/vite preview "$preview" --host 127.0.0.1 --port 8780 --strictPort
```
-Open . Vite supports the byte-range requests the player uses to jump to a shot.
+Open the [site entry](http://127.0.0.1:8780/OpenDirector/), or go directly to the [English page](http://127.0.0.1:8780/OpenDirector/en/) or the [Simplified Chinese page](http://127.0.0.1:8780/OpenDirector/zh-cn/). The site entry uses your last manual language choice, then the browser language, and defaults to English if neither selects a supported language. With JavaScript disabled, the entry offers links to both pages. Vite supports the byte-range requests the player uses to jump to a shot.
+
+The local preview uses production URLs for canonical and `hreflang` links. The site entry is the `x-default` alternate. The [sitemap](http://127.0.0.1:8780/OpenDirector/sitemap.xml) lists only the two language pages.
## Set up GitHub Pages
1. In `ThinkFlowLab/OpenDirector`, a repository maintainer or admin opens **Settings > Pages**. Under **Build and deployment**, set **Source** to **GitHub Actions**. The repository supplies the [Website workflow](../.github/workflows/website.yml) and its deployment permissions. It uses GitHub's built-in token.
2. Merge the website changes into `main`. The Website workflow builds the site and runs its Chromium checks. When they pass, the workflow deploys to the `github-pages` environment. Pull requests run the checks only. To deploy the current `main` manually, open **Actions > Website > Run workflow**, select `main`, and click **Run workflow**.
-3. Open the URL in the successful `deploy` job. The default address is . Switch languages and check that each download points to the expected Release asset. To roll back a site change, revert it on `main`.
+3. After `deploy` succeeds, open the [site entry](https://thinkflowlab.github.io/OpenDirector/), the [English page](https://thinkflowlab.github.io/OpenDirector/en/), and the [Simplified Chinese page](https://thinkflowlab.github.io/OpenDirector/zh-cn/). Switch languages and check that each download points to the expected Release asset. Verify that each language page has a self-referencing canonical, the `hreflang` links include both language pages and the `x-default` entry, and the [sitemap](https://thinkflowlab.github.io/OpenDirector/sitemap.xml) lists only the two language pages. To roll back a site change, revert it on `main`.
## Publish a desktop release
1. Follow the [release guide](../docs/development/release.md). Check that Release checks and the latest nightly `gate-parity` passed. After the version-bump PR merges, push a new `vMAJOR.MINOR.PATCH` tag on that merge commit to the official repository. The tag must match the version in `apps/desktop/package.json`.
2. The [Desktop release workflow](../.github/workflows/desktop-release.yml) creates or reuses a draft for that tag. macOS and Windows each build and test their installer, then attach it and its `.sha256` file to the draft. For a release that ships both platforms, expect an Apple Silicon DMG, a Windows x64 EXE, and two checksum files.
3. Complete the [desktop acceptance checks](../docs/development/desktop.md#delivery-boundary) for each platform you plan to publish. In **Releases**, open the draft, verify its assets, review the English release notes, and click **Publish release**. Retry failed packaging jobs while the release is still a draft.
-4. Publishing the release triggers a Website build on `main`. For each platform, the build selects the highest official version with an uploaded installer for that architecture. The download URL, version label and release notes come from that release. If you add an installer after publication, run **Actions > Website > Run workflow** on `main` to refresh the site.
+4. Publishing the release triggers a Website build on `main`. For each platform, the build selects the highest official version with an uploaded installer for that architecture. Both language pages use that release's download URL, version label and release notes link. If you add an installer after publication, run **Actions > Website > Run workflow** on `main` to refresh the site.
A Windows-only release updates the Windows download. Mac users keep the latest available Mac package. Until a platform has an official installer, its download points to the [tested desktop preview](https://github.com/FayeSpica/OpenDirector/releases/tag/v0.1.4-desktop-test.23) and carries a test-build label. If the GitHub API request fails, the build stops and the previous deployment stays online.
@@ -35,20 +37,22 @@ OpenDirector includes the version in each installer filename. GitHub's `releases
### 本地预览
-在仓库根目录运行上面的命令。构建时需要联网读取公开的 GitHub Releases。如果缺少 Vite,先运行 `npm ci`。打开 。Vite 支持分段读取视频,可以直接跳到所选镜头。
+在仓库根目录运行上面的命令。构建时需要联网读取公开的 GitHub Releases。如果缺少 Vite,先运行 `npm ci`。可以打开[网站入口](http://127.0.0.1:8780/OpenDirector/),也可以直达[英文页](http://127.0.0.1:8780/OpenDirector/en/)或[简体中文页](http://127.0.0.1:8780/OpenDirector/zh-cn/)。网站入口优先采用上次手动选择的语言,其次采用浏览器语言。两者都未匹配到支持的语言时,默认进入英文页。关闭 JavaScript 后,仍可在入口手动选择语言。Vite 支持分段读取视频,可以直接跳到所选镜头。
+
+本地预览中的 canonical 和 `hreflang` 链接使用生产网址。网站入口对应 `x-default`。[站点地图](http://127.0.0.1:8780/OpenDirector/sitemap.xml)只列出两个语言页的生产网址。
### 首次配置 GitHub Pages
1. 具有 Maintain 或 Admin 权限的维护者打开官方仓库 `ThinkFlowLab/OpenDirector` 的 **Settings > Pages**,在 **Build and deployment** 中将 **Source** 设为 **GitHub Actions**。仓库提供了 [Website 工作流](../.github/workflows/website.yml),其中已声明部署权限,使用 GitHub 内置令牌。
2. 将网站改动合入 `main`。Website 会构建网站并运行 Chromium 检查,通过后部署到 `github-pages` 环境。PR 只运行检查。需要手动部署时,打开 **Actions > Website > Run workflow**,选择 `main`,点击 **Run workflow**。
-3. 打开成功的 `deploy` 任务给出的网址,默认地址是 。切换语言,确认两个平台的下载链接指向预期的 Release 附件。如需回退网站,在 `main` 撤销对应改动。
+3. `deploy` 成功后,分别打开[网站入口](https://thinkflowlab.github.io/OpenDirector/)、[英文页](https://thinkflowlab.github.io/OpenDirector/en/)和[简体中文页](https://thinkflowlab.github.io/OpenDirector/zh-cn/)。切换语言,确认两个平台的下载链接指向预期的 Release 附件。检查两个语言页的 canonical 是否各自指向自身,`hreflang` 是否包含两个语言页和 `x-default` 入口,以及[站点地图](https://thinkflowlab.github.io/OpenDirector/sitemap.xml)是否只列出两个语言页。如需回退网站,在 `main` 撤销对应改动。
### 发布桌面版
1. 按[版本发布指南](../docs/development/release.md)确认 Release checks 和最近一次 nightly 的 `gate-parity` 均已通过。版本号 PR 合入 `main` 后,在该合入提交上打新的 `vMAJOR.MINOR.PATCH` 标签并推到官方仓库。标签中的版本号须与 `apps/desktop/package.json` 一致。
2. [Desktop release 工作流](../.github/workflows/desktop-release.yml)会为该标签创建或复用 Release 草稿。macOS 和 Windows 各自打包,通过本机安装和启动检查后,把安装包和对应的 `.sha256` 文件上传到同一份草稿。两个平台都发布时,草稿应包含 Apple Silicon DMG、Windows x64 EXE 和两份校验文件。
3. 维护者在各发布平台完成[桌面版验收](../docs/development/desktop.zh-CN.md),再到 **Releases** 打开草稿,核对附件和英文发布说明,点击 **Publish release**。如果打包任务失败,在草稿状态下重跑。
-4. 公开 Release 后,Website 会在 `main` 上重新构建。对每个平台,构建脚本选取包含对应架构安装包的最高正式版本,并从该 Release 读取下载地址、版本号和发布说明。如果在公开后补传了安装包,到 **Actions > Website > Run workflow** 选择 `main` 刷新网站即可。
+4. 公开 Release 后,Website 会在 `main` 上重新构建。对每个平台,构建脚本选取包含对应架构安装包的最高正式版本。两个语言页面都使用该 Release 的下载地址、版本号和发布说明链接。如果在公开后补传了安装包,到 **Actions > Website > Run workflow** 选择 `main` 刷新网站即可。
如果本次只发 Windows 包,Windows 下载会更新,Mac 用户仍能下载已有的最新 Mac 包。某个平台首次发布正式安装包前,网站提供[已验证的桌面测试版](https://github.com/FayeSpica/OpenDirector/releases/tag/v0.1.4-desktop-test.23),并标明「测试版」。如果请求 GitHub API 失败,本次构建停止,线上继续使用上一次成功部署的页面。
diff --git a/website/build.mjs b/website/build.mjs
index 7f8acc28b..b9cdafbf0 100644
--- a/website/build.mjs
+++ b/website/build.mjs
@@ -1,41 +1,105 @@
-import { readFile, writeFile } from "node:fs/promises";
+import { mkdir, readFile, writeFile } from "node:fs/promises";
+import { join } from "node:path";
import { resolveInstallers } from "./installers.mjs";
+import { messages } from "./messages.mjs";
+
+const siteUrl = "https://thinkflowlab.github.io/OpenDirector/";
+const repository = "https://github.com/ThinkFlowLab/OpenDirector";
+const pages = {
+ "en-US": { path: "en/", hreflang: "en" },
+ "zh-CN": { path: "zh-cn/", hreflang: "zh-CN" },
+};
+
+const alternates = [
+ ...Object.values(pages).map(({ path, hreflang }) => [hreflang, siteUrl + path]),
+ ["x-default", siteUrl],
+].map(([lang, url]) => ``).join("\n ");
function escapeHtml(value) {
- return value.replaceAll("&", "&").replaceAll('"', """).replaceAll("<", "<");
+ return value.replaceAll("&", "&").replaceAll('"', """).replaceAll("<", "<").replaceAll(">", ">");
+}
+
+function renderPage(template, values, html) {
+ return template.replace(/{{(\w+)}}/g, (_, key) => {
+ if (Object.hasOwn(html, key)) return html[key];
+ if (Object.hasOwn(values, key)) return escapeHtml(values[key]);
+ throw new Error(`Missing website template value ${key}`);
+ });
}
-export function renderDownloadPage(template, installers) {
+export function renderDownloadPage(template, installers, locale = "en-US") {
+ const copy = messages[locale];
+ const page = pages[locale];
const options = [];
const notes = new Map();
- for (const [system, label, format] of [["mac", "macOS (Apple silicon)", "DMG"], ["windows", "Windows (x64)", "EXE"]]) {
- const name = `${label}`;
+ for (const [system, format] of [["mac", "DMG"], ["windows", "EXE"]]) {
+ const name = `${escapeHtml(copy[system])}`;
const installer = installers[system];
if (!installer) {
- options.push(`
${name}Installer unavailable
`);
+ options.push(`
${name}${escapeHtml(copy.unavailable)}
`);
continue;
}
- const test = installer.test ? ' · Test build' : "";
+ const test = installer.test ? ` · ${escapeHtml(copy.testBuild)}` : "";
options.push(`