-
Notifications
You must be signed in to change notification settings - Fork 56
feat: 独立页动态导航、后台侧栏固定、移动端代码块优化、标签折叠 #40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
cf4e559
cc9bb93
a1535af
4185e93
a36ddd9
da2a3ca
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,32 +1,55 @@ | ||
| # 依赖 | ||
| # ============================================================ | ||
| # Monolith .gitignore — 什么该推送,什么不该推送 | ||
| # ============================================================ | ||
|
|
||
| # ────────────────────── 依赖目录(不推送)────────────────────── | ||
| node_modules/ | ||
| .next/ | ||
|
|
||
| # 构建产出 | ||
| # ────────────────────── 构建产出(不推送)────────────────────── | ||
| dist/ | ||
| .wrangler/ | ||
| .turbo/ | ||
|
|
||
| # 环境变量 | ||
| # ────────────────────── 环境变量与密钥(绝不推送)────────────────── | ||
| # 所有 .env 文件都可能含密钥,禁止推送 | ||
| .env | ||
| .env.local | ||
| .env.* | ||
| .env.*.local | ||
| .env.production | ||
| !.env.example | ||
|
|
||
| # Wrangler 本地密钥(含 ADMIN_PASSWORD / JWT_SECRET 等) | ||
| .dev.vars | ||
|
|
||
| # 系统文件 | ||
| # ────────────────────── 系统与编辑器临时文件(不推送)────────────── | ||
| .DS_Store | ||
| Thumbs.db | ||
| *.swp | ||
| *.swo | ||
| *~ | ||
|
|
||
| # IDE | ||
| # IDE 配置 | ||
| .idea/ | ||
| .vscode/ | ||
| *.code-workspace | ||
|
|
||
| # Wrangler 本地数据 | ||
| .wrangler/ | ||
|
|
||
| # AI 助手记忆库(含私人配置、密码等,禁止推送) | ||
| # ────────────────────── AI 工具私有数据(绝不推送)────────────────── | ||
| # 记忆库含密码、PAT、私人偏好等敏感信息 | ||
| .agents/ | ||
|
|
||
| # 编辑器/AI 全局配置(Antigravity、Gemini、OpenCode 等) | ||
| GEMINI.md | ||
|
|
||
| # ────────────────────── 日志与调试产物(不推送)────────────────── | ||
| *.log | ||
| npm-debug.log* | ||
|
|
||
| # ────────────────────── 必须推送的重要文件 ────────────────────── | ||
| # 以下文件虽然常被误加 gitignore,但必须跟踪: | ||
| # ✅ package-lock.json — 锁定依赖版本,CI 的 npm ci 依赖它 | ||
| # ✅ client/functions/ — Pages Functions 反向代理,漏掉则 /api/* 回退为首页 HTML | ||
| # ✅ scripts/ — 部署脚本 (deploy-cloudflare.mjs) | ||
| # ✅ AGENTS.md — OpenCode 项目规则(不含密钥) | ||
| # ✅ opencode.json — OpenCode 项目配置(含 MCP 远程服务,不含本地密钥) | ||
| # ✅ .github/ — CI/CD workflows、Issue/PR 模板、分支保护 | ||
| # ✅ SECURITY.md — 安全政策 | ||
| # ✅ PRIVACY.md — 隐私政策 |
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| # Monolith 项目规则 | ||
|
|
||
| ## 项目概览 | ||
| Monolith 是基于 Cloudflare 边缘计算的全栈博客系统。 | ||
| - 前端:Vite 6 + React 19 + Tailwind CSS v4 + shadcn/ui + wouter | ||
| - 后端:Hono Workers + Drizzle ORM | ||
| - 代理层:Pages Functions(反向代理 /api/* /cdn/* /rss.xml) | ||
| - 存储:D1 (SQLite) + R2 (对象存储),支持 Turso/PostgreSQL/S3 切换 | ||
| - 主题:OKLCH 色彩空间双主题系统(暗色 Slate & Cyan / 亮色模式) | ||
|
|
||
| ## 架构要点 | ||
| - 存储层采用适配器模式:路由只依赖 `IDatabase` / `IObjectStorage` 接口,通过 `DB_PROVIDER` / `STORAGE_PROVIDER` 环境变量切换适配器 | ||
| - Pages Functions 代理层拦截 `/api/*`、`/cdn/*`、`/rss.xml`,转发到 Workers | ||
| - Pages Functions 的 `tsconfig.json` 独立引入 `@cloudflare/workers-types`,避免与主项目 DOM 类型冲突 | ||
| - DOMPurify 净化 Markdown 渲染输出,白名单允许 iframe/video 嵌入 | ||
| - `searchPosts()` 只搜索 `title + excerpt`,不扫描 `content` 大字段 | ||
|
|
||
| ## 工作区路径 | ||
| - 项目根目录:`/home/easy/001/Monolith` | ||
| - 客户端:`/home/easy/001/Monolith/client` | ||
| - 服务端:`/home/easy/001/Monolith/server` | ||
|
|
||
| ## 分支管理 | ||
| - 生产分支:`main`(Cloudflare Pages 自动部署绑定) | ||
| - 开发分支:`dev` | ||
| - 工作流:dev 开发 → commit → push → PR → squash merge 到 main → 部署 | ||
| - 严禁直接向 main 推送 | ||
|
|
||
| ## 常用命令 | ||
| - `npm run dev` — 同时启动前后端(client :5173, server :8787) | ||
| - `npm run dev:client` / `npm run dev:server` — 单独启动 | ||
| - `npm run build` — 构建前端 | ||
| - `npm run deploy:cloudflare` — 一键部署(迁移 + Workers + Pages) | ||
| - `npm run db:migrate:local` / `db:migrate:remote` — 数据库迁移 | ||
| - Node.js 需要 `source $HOME/.nvm/nvm.sh` 后才可用 | ||
|
|
||
| ## 部署铁律 | ||
| - 使用 `npm run deploy:cloudflare` 一键部署,禁止手动 `wrangler pages deploy` | ||
| - 必须从 `client/` 目录部署 `dist`,否则 Pages Functions 会被遗漏 | ||
| - `package-lock.json` 绝不能放入 `.gitignore` | ||
| - CI "Sync Worker secrets" 步骤通过 `wrangler secret put` 注入 ADMIN_PASSWORD / JWT_SECRET | ||
|
|
||
| ## 踩坑记录(项目特有) | ||
| - D1 迁移标记不同步时需手动 `INSERT INTO d1_migrations` | ||
| - Cloudflare CDN 有短暂缓存,验证时用部署唯一 URL | ||
| - 本地 `client/functions/api/` 目录的 tsconfig 独立,不与主项目混用 | ||
| - Hono v4 `verify()` 需要 3 个参数:`verify(token, secret, "HS256")` | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🌐 Web query:
💡 Result: In Hono v4 (hono/jwt), the jwt verify helper function signature is: verify(token: string, secret: string, alg?: 'HS256'; issuer?: string | RegExp): Promise It does NOT require an explicit algorithm argument like "HS256". Reason: the docs show the alg parameter as optional (alg?: ... ) and note that the default is HS256. In other words, you can call verify(token, secret) and Hono will use the default algorithm. Citations: 更正 Hono v4 jwt verify() 参数用法。 AGENTS.md 第 47 行声称 🤖 Prompt for AI Agents |
||
|
|
||
| ## 记忆库 | ||
| 项目记忆库路径:`.agents/memory_bank/` | ||
| - `README.md` — 索引入口 | ||
| - `monolith_architecture.md` — 完整架构手册 | ||
| - `monolith_roadmap.md` — 功能路线图 | ||
| - `monolith_v1_status.md` — V1 状态报告 | ||
| - `system_config.md` — 系统配置与凭据 | ||
| - `ui_design_parameters.md` — UI 排版设计规范 | ||
| - `typecho_dev_guide.md` — Typecho 开发指南(已弃用项目) | ||
|
|
||
| ## CI 与安全 | ||
| - 仓库:`https://github.com/one-ea/Monolith` | ||
| - GitHub PAT:已配置在 system_config.md | ||
| - 后台密码:`monolith2026` | ||
| - 分支保护:main 需要 1 人审批 + 线性历史 + 状态检查 | ||
|
Comment on lines
+61
to
+63
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 文档中出现敏感信息与明文密码,需立即移除。
🤖 Prompt for AI Agents |
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
修复 Markdown 语法以避免 lint 告警。
/api/* /cdn/* /rss.xml这类写法容易触发MD037,建议对*转义或整体包裹代码样式,避免 CI 文档检查噪音。🧰 Tools
🪛 markdownlint-cli2 (0.22.0)
[warning] 7-7: Spaces inside emphasis markers
(MD037, no-space-in-emphasis)
🤖 Prompt for AI Agents