diff --git a/packages/core/scripts/generate-site.mjs b/packages/core/scripts/generate-site.mjs index 042fed9..64b79ac 100644 --- a/packages/core/scripts/generate-site.mjs +++ b/packages/core/scripts/generate-site.mjs @@ -454,9 +454,9 @@ function generateSite(siteKey) { console.log(`\n=== 生成站点 ${siteKey} (port ${site.port}, theme ${site.theme}) ===`); fs.mkdirSync(siteRoot, { recursive: true }); - // 清空生成物,但保留本地环境与依赖 + // 清空生成物,但保留本地环境、依赖与品牌资产(public 内含 codex 生成的 icon/logo) for (const entry of fs.readdirSync(siteRoot)) { - if (entry === ".env.local" || entry === "node_modules") continue; + if (entry === ".env.local" || entry === "node_modules" || entry === "public") continue; fs.rmSync(path.join(siteRoot, entry), { recursive: true, force: true }); } @@ -761,13 +761,33 @@ export default getRequestConfig(async ({ requestLocale }) => { writeFileSafe(path.join(siteRoot, "src/i18n/request.ts"), requestSrc); // ---------- 9) public + env ---------- + // cpSync 前备份 codex 品牌资产(icon.svg / logo.svg),拷贝后恢复 + const brandAssets = ["icon.svg", "logo.svg"]; + const backupDir = path.join(siteRoot, ".brand-backup"); + for (const asset of brandAssets) { + const assetPath = path.join(siteRoot, "public", asset); + if (fs.existsSync(assetPath)) { + fs.mkdirSync(backupDir, { recursive: true }); + fs.copyFileSync(assetPath, path.join(backupDir, asset)); + } + } fs.cpSync(path.join(CORE_ROOT, "public"), path.join(siteRoot, "public"), { recursive: true }); + for (const asset of brandAssets) { + const backupPath = path.join(backupDir, asset); + if (fs.existsSync(backupPath)) { + fs.copyFileSync(backupPath, path.join(siteRoot, "public", asset)); + fs.rmSync(backupDir, { recursive: true, force: true }); + } + } // 品牌首字母 favicon(SVG,无 Emoji) const initial = site.brand.name.slice(0, 1).toUpperCase(); - writeFileSafe( - path.join(siteRoot, "public", "icon.svg"), - `${initial}\n` - ); + // favicon:保留已生成的品牌 icon.svg(codex 生成),不存在时才写字母占位 + if (!fs.existsSync(path.join(siteRoot, "public", "icon.svg"))) { + writeFileSafe( + path.join(siteRoot, "public", "icon.svg"), + `${initial}\n` + ); + } writeFileSafe( path.join(siteRoot, ".env.example"), `# ${site.brand.name} 环境变量(与底座共享同一套 PostgreSQL / Better Auth / Admin) diff --git a/packages/core/src/features/forms/components/form-shell.tsx b/packages/core/src/features/forms/components/form-shell.tsx index 00cb6b7..0b1841e 100644 --- a/packages/core/src/features/forms/components/form-shell.tsx +++ b/packages/core/src/features/forms/components/form-shell.tsx @@ -120,12 +120,8 @@ export function FormShell({ >
- - {initial} - + {/* eslint-disable-next-line @next/next/no-img-element */} + {brand}

{title}

diff --git a/packages/core/src/kit/theme-header.tsx b/packages/core/src/kit/theme-header.tsx index afa086c..5a3e769 100644 --- a/packages/core/src/kit/theme-header.tsx +++ b/packages/core/src/kit/theme-header.tsx @@ -72,9 +72,9 @@ export function ThemeHeader({
{/* Logo */} - - {brand.name.slice(0, 1)} - + {/* 站点 logo(codex 生成的 icon.svg,自带品牌色底,深浅通吃) */} + {/* eslint-disable-next-line @next/next/no-img-element */} + {brand.name} diff --git a/sites/ai-stack/public/icon.svg b/sites/ai-stack/public/icon.svg index 4ec2deb..eb08c71 100644 --- a/sites/ai-stack/public/icon.svg +++ b/sites/ai-stack/public/icon.svg @@ -1 +1 @@ -A + diff --git a/sites/ai-stack/public/logo.svg b/sites/ai-stack/public/logo.svg new file mode 100644 index 0000000..909ff7f --- /dev/null +++ b/sites/ai-stack/public/logo.svg @@ -0,0 +1 @@ +AI Stack diff --git a/sites/devai-tools/public/icon.svg b/sites/devai-tools/public/icon.svg index c32f121..675fd47 100644 --- a/sites/devai-tools/public/icon.svg +++ b/sites/devai-tools/public/icon.svg @@ -1 +1 @@ -D + diff --git a/sites/devai-tools/public/logo.svg b/sites/devai-tools/public/logo.svg new file mode 100644 index 0000000..7a8b549 --- /dev/null +++ b/sites/devai-tools/public/logo.svg @@ -0,0 +1 @@ +DevAI.tools diff --git a/sites/findai/public/icon.svg b/sites/findai/public/icon.svg index 514e5ff..b309870 100644 --- a/sites/findai/public/icon.svg +++ b/sites/findai/public/icon.svg @@ -1 +1 @@ -F + diff --git a/sites/findai/public/logo.svg b/sites/findai/public/logo.svg new file mode 100644 index 0000000..8ff17bb --- /dev/null +++ b/sites/findai/public/logo.svg @@ -0,0 +1 @@ +findai diff --git a/sites/findai/tsconfig.json b/sites/findai/tsconfig.json index c20f005..95fd293 100644 --- a/sites/findai/tsconfig.json +++ b/sites/findai/tsconfig.json @@ -15,7 +15,7 @@ "moduleResolution": "bundler", "resolveJsonModule": true, "isolatedModules": true, - "jsx": "preserve", + "jsx": "react-jsx", "incremental": true, "plugins": [ { @@ -55,7 +55,8 @@ "next-env.d.ts", "**/*.ts", "**/*.tsx", - ".next/types/**/*.ts" + ".next/types/**/*.ts", + ".next/dev/types/**/*.ts" ], "exclude": [ "node_modules" diff --git a/sites/launchai/public/icon.svg b/sites/launchai/public/icon.svg index ffbca57..cff9bc4 100644 --- a/sites/launchai/public/icon.svg +++ b/sites/launchai/public/icon.svg @@ -1 +1,11 @@ -L + + + + + + + + + + + diff --git a/sites/launchai/public/logo.svg b/sites/launchai/public/logo.svg new file mode 100644 index 0000000..6edc966 --- /dev/null +++ b/sites/launchai/public/logo.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + + LaunchAI + diff --git a/sites/launchai/tsconfig.json b/sites/launchai/tsconfig.json index c20f005..95fd293 100644 --- a/sites/launchai/tsconfig.json +++ b/sites/launchai/tsconfig.json @@ -15,7 +15,7 @@ "moduleResolution": "bundler", "resolveJsonModule": true, "isolatedModules": true, - "jsx": "preserve", + "jsx": "react-jsx", "incremental": true, "plugins": [ { @@ -55,7 +55,8 @@ "next-env.d.ts", "**/*.ts", "**/*.tsx", - ".next/types/**/*.ts" + ".next/types/**/*.ts", + ".next/dev/types/**/*.ts" ], "exclude": [ "node_modules" diff --git a/sites/the-ai-ledger/public/icon.svg b/sites/the-ai-ledger/public/icon.svg index 996667b..976807a 100644 --- a/sites/the-ai-ledger/public/icon.svg +++ b/sites/the-ai-ledger/public/icon.svg @@ -1 +1 @@ -T +L diff --git a/sites/the-ai-ledger/public/logo.svg b/sites/the-ai-ledger/public/logo.svg new file mode 100644 index 0000000..34c5c9f --- /dev/null +++ b/sites/the-ai-ledger/public/logo.svg @@ -0,0 +1 @@ +LThe AI Ledger diff --git a/sites/the-ai-ledger/tsconfig.json b/sites/the-ai-ledger/tsconfig.json index c20f005..95fd293 100644 --- a/sites/the-ai-ledger/tsconfig.json +++ b/sites/the-ai-ledger/tsconfig.json @@ -15,7 +15,7 @@ "moduleResolution": "bundler", "resolveJsonModule": true, "isolatedModules": true, - "jsx": "preserve", + "jsx": "react-jsx", "incremental": true, "plugins": [ { @@ -55,7 +55,8 @@ "next-env.d.ts", "**/*.ts", "**/*.tsx", - ".next/types/**/*.ts" + ".next/types/**/*.ts", + ".next/dev/types/**/*.ts" ], "exclude": [ "node_modules"