Move seed.sql out of migrations and add SEO structured data

- Relocate seed.sql to scripts/ so wrangler d1 migrations apply
  doesn't treat it as a migration; update package.json, setup.mjs,
  README, and all AGENTS.md references.
- Add src/lib/schema-org.ts builders (LocalBusiness, FAQPage,
  BlogPosting, BreadcrumbList) and emit JSON-LD via Base.astro.
- Add lastmod to sitemap entries.
- Set real site domain, worker route, and D1/KV ids.
- Improve image loading hints and heading semantics across site
  components; switch BlogIndex to client:idle.
This commit is contained in:
2026-09-13 16:21:59 +08:00
parent f6b885efe6
commit 6dedb5469f
28 changed files with 255 additions and 108 deletions
@@ -45,7 +45,7 @@ src/pages/admin/content/[kind].astro 用 parseForm
src/pages/admin/cases.astro 用 parseForm
src/pages/admin/settings.astro 用 parseForm
src/pages/admin/index.astro 加入口連結
migrations/seed.sql 加 AI 設定 + 示範關鍵字
scripts/seed.sql 加 AI 設定 + 示範關鍵字
.dev.vars.example 加 AI_API_KEY / TAVILY_API_KEY
README.md / AGENTS.md 各層 同步文件
```
@@ -620,7 +620,7 @@ Expected: PASS。`npm run dev` → 提交一個空標題,見到紅色錯誤字
**Files:**
- Modify: `src/db/schema.ts`
- Modify: `migrations/seed.sql`
- Modify: `scripts/seed.sql`
- Generate: `migrations/0002_*.sql`(由 drizzle-kit
- [x] **Step 1: `posts` 加 `focusKeyword`**
@@ -1399,7 +1399,7 @@ async function main() {
const migrate = await rl.question("而家套用雲端 migration + seed(y/N)");
if (migrate.trim().toLowerCase() === "y") {
execSync(`npx wrangler d1 migrations apply ${DB_NAME} --remote`, { stdio: "inherit" });
execSync(`npx wrangler d1 execute ${DB_NAME} --remote --file=./migrations/seed.sql`, { stdio: "inherit" });
execSync(`npx wrangler d1 execute ${DB_NAME} --remote --file=./scripts/seed.sql`, { stdio: "inherit" });
}
console.log("\n提示:上線前記得改 astro.config.mjs 嘅 site 做真域名。");
@@ -97,7 +97,7 @@ DeepSeek 思考模式**預設開啟**effort `high`),會令:`temperature
|---|---|
| `src/lib/ai.ts` | 通用化 `buildSystemPrompt`;預設 baseUrl/model 改 DeepSeek`callChat` 加 conditional thinking disabled、`max_tokens: 4000` |
| `src/schemas/ai.ts` | `ai_base_url` / `ai_chat_model` 預設值同步 |
| `migrations/seed.sql` | `ai_base_url` / `ai_chat_model` 改預設;`ai_business_context` 改通用格式範本 |
| `scripts/seed.sql` | `ai_base_url` / `ai_chat_model` 改預設;`ai_business_context` 改通用格式範本 |
| `src/pages/admin/ai.astro` | 模型/URL 預設值同步;公司背景+寫作風格加 placeholder/格式說明 |
| `src/lib/AGENTS.md`、根 `AGENTS.md` | 更新 AI Blog 合約描述(DeepSeek 預設、通用提示詞) |