Commit Graph
17 Commits
Author SHA1 Message Date
philip-cat 00502e5e52 Update DOX docs for R2 image upload 2026-09-12 10:10:21 +08:00
philip-cat df330ffd70 Add cover image upload to blog posts with cleanup 2026-09-12 10:08:01 +08:00
philip-cat 370ec568aa Add image upload to cases with cleanup 2026-09-12 10:06:16 +08:00
philip-cat 6e550c0d5b Add image upload to site settings with old-file cleanup 2026-09-12 10:04:23 +08:00
philip-cat 74792c595a Improve ImageField accessibility and upload robustness 2026-09-12 10:03:06 +08:00
philip-cat fbc383decf Add ImageField component and client-side upload script 2026-09-12 10:01:04 +08:00
philip-cat e18c3306d4 docs: document media upload/serving endpoints in src/AGENTS.md 2026-09-12 09:58:40 +08:00
philip-cat 8d1ffa9ab5 Add R2 upload and media serving endpoints 2026-09-12 09:58:29 +08:00
philip-cat 558fe0487b docs: record media.ts in src/lib AGENTS.md 2026-09-12 09:56:41 +08:00
philip-cat 13570689dd Add media helper for R2 keys and cleanup 2026-09-12 09:56:32 +08:00
philip-cat 002cf368c3 docs: record R2 MEDIA binding in AGENTS.md 2026-09-12 09:54:53 +08:00
philip-cat 125030ce2e Add R2 MEDIA binding and setup script 2026-09-12 09:54:40 +08:00
philip-cat 47f14b79e3 Add R2 image upload implementation plan 2026-09-12 00:39:48 +08:00
philip-cat cd48930044 Add R2 image upload design spec 2026-09-12 00:38:47 +08:00
philip-cat 81fc515d6e AI Blog 改用 DeepSeek 官方並通用化提示詞
buildSystemPrompt 不再綁死太陽能行業,角色與公司資料改由
後台 ai_context_prompt / ai_business_context 提供;預設供應商
改為 https://api.deepseek.com 與 deepseek-flash。callChat 只在
baseUrl 含 deepseek.com 時加 thinking: { type: "disabled" },
並將 max_tokens 提升至 4000,避免思考模式令 temperature 失效
同正文被截斷。

同步更新 schemas、seed、/admin/ai 預設值同 placeholder,
以及 AGENTS.md、spec、plan 文件。
2026-09-12 00:31:26 +08:00
philip-cat fdee1aabd7 Add Zod validation layer and AI blog generation
Introduce a schema-first validation layer and an AI blog generation
feature, plus one-command Cloudflare provisioning.

- src/schemas/ holds Zod input schemas for post, content, case,
  settings, AI, and keywords; parseForm() in src/lib/form.ts validates
  FormData and returns per-field errors.
- Migrate all admin POST handlers to parseForm, showing field-level
  errors and only redirecting once validation passes.
- Add blog_keywords table and posts.focus_keyword (migration 0002);
  uniqueSlug() centralised in src/data/content.ts.
- Add src/lib/ai.ts (OpenAI-compatible chat completions + optional
  Tavily research) and /admin/ai for AI settings, keyword queue, and
  draft generation.
- Add scripts/setup.mjs (npm run setup) to provision D1/KV, set
  secrets, and optionally migrate, seed, and deploy.
- Document AI secrets, Workers Builds deploy flow, and new schemas
  across README and AGENTS docs.
2026-09-11 23:49:18 +08:00
philip-cat 5b69bc818a first commit 2026-09-11 15:49:41 +08:00