18 Commits

Author SHA1 Message Date
xfy
ce14c476b5 refactor: replace string-based navigation with typed Route and Link components 2026-06-04 14:55:18 +08:00
xfy
5d018864c2 refactor: remove PageLayout from all frontend pages, delegate to FrontendLayout
- Remove PageLayout wrapper from Home, HomePage, Archives, Tags,
  TagDetail, PostDetail, Search, and About components
- Remove unused imports: use_nav_items, use_route, PageLayout, Route
- Pages now render only their content; Header/Footer are provided by
  FrontendLayout via the router's #[layout] attribute
- Skeleton screens (DelayedSkeleton) remain in data-loading branches
- This eliminates redundant Header/Footer re-mounting on every route
  change, which was the primary source of page transition flicker

Files changed:
- src/pages/home.rs: remove PageLayout, keep HomeInfo + HomePosts
- src/pages/about.rs: remove PageLayout, render content directly
- src/pages/archives.rs: remove PageLayout, keep header + ArchivesContent
- src/pages/post_detail.rs: remove PageLayout, keep PostDetailContent
- src/pages/search.rs: remove PageLayout, keep search form + results
- src/pages/tags.rs: remove PageLayout from Tags and TagDetail
2026-06-03 18:38:11 +08:00
xfy
778726251a fix: remove SuspenseBoundary, render skeleton screens directly in loading branch 2026-06-03 17:59:38 +08:00
xfy
754c1f5b86 feat: wrap all skeleton screens with DelayedSkeleton to prevent flicker 2026-06-03 17:43:34 +08:00
xfy
076448d6ed feat: add HomeSkeleton and replace generic fallback on home page 2026-06-03 17:09:20 +08:00
xfy
6cfe664085 feat: SSR for home and tags pages 2026-06-03 14:40:15 +08:00
xfy
f3c1718cd0 feat: add use_delayed_loading hook to prevent skeleton flash 2026-06-02 17:53:04 +08:00
xfy
1950646bef feat: add shared components, new pages, and pagination 2026-06-02 17:33:28 +08:00
xfy
b6cabe489f feat: migrate frontend to database-driven posts
- Replace hardcoded POSTS with API-driven data in home, archives, tags
- Add post detail page /post/:slug with HTML rendering
- Add admin posts management page with list and soft delete
- Update dashboard with real stats from database
- Add admin navigation for posts management
- Fix PartialEq derives for Post, Tag, PostStats models
- Use use_resource and use_memo for data fetching with proper loading states
2026-06-02 17:33:28 +08:00
李林军
4093178fc3 添加tracing日志并重构服务器启动逻辑 2026-05-27 11:39:09 +08:00
xfy
61376f6ba9 修复 admin 路由切换闪烁,全局替换原生导航为客户端路由
- 新增全局 UserContext,将用户认证状态提升到 App 级别缓存
- 将 /admin 和 /admin/write 改为嵌套路由,AdminLayout 作为共享父布局
- AdminLayout 使用 Outlet 渲染子页面,避免路由切换时重复挂载
- 修复所有原生 <a> 标签导致的整页刷新问题:
  - Header 导航栏 Logo 和 NavItem
  - 首页文章卡片、分页按钮
  - 归档页文章条目
  - 标签页标签云、文章卡片、标签链接
  - 登录/注册页面链接
  - Dashboard 快捷操作按钮

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-27 00:18:15 +08:00
xfy
8b9c6aa83d 重构 admin 模块,新增共享组件和文章撰写页面
- 将 monolithic admin.rs 拆分为 admin/ 目录模块(dashboard、write)
- 新增 components 模块:Header、Footer、AdminLayout
- 新增 /admin/write 文章撰写页面,支持 Markdown 实时预览
- 添加 pulldown-cmark 依赖用于 Markdown 渲染
- .env 移出版本控制,新增 .env.example 模板
- Home、Archives、Tags、Login、Register 等页面适配新组件

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 16:13:18 +08:00
xfy
06302b14de 实现 PaperMod 风格标签页面:标签列表 + 标签详情
- 新增 /tags 页面:展示所有标签及文章数量,按字母排序
- 新增 /tags/:tag 动态路由:展示该标签下的文章列表
- Post/POSTS 改为 pub,供 tags 模块复用
- NavItem 高亮也匹配 TagDetailPage
- 修复 CSS 路径为绝对路径,解决子路由下样式失效

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 13:43:38 +08:00
xfy
7599bfbb13 实现 PaperMod 风格归档页面,支持按年份月份分组
- 新增 ArchivesPage 组件,三级结构:年份 → 月份 → 文章
- Header/NavItem/Footer 改为 pub 共享,NavItem 通过路由动态判断高亮
- 编译 Tailwind CSS 包含归档页面所需 utility classes

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 13:31:35 +08:00
xfy
a15394c935 返回顶部按钮迁移为 PaperMod 风格
- button "↑" → <a href="#top"> + 内联 SVG 双上箭头图标
- 滚动超过一屏才显示,添加 opacity/translate-y 过渡动画
- 平滑滚动到顶部并清除 URL hash(history.replaceState)
- 无障碍属性:aria-label、title、accesskey="g"

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 13:20:25 +08:00
xfy
f52b3165da 首页首区改为个人简介(HomeInfo)
- 删除 FirstEntry(首篇文章精选)组件
- 新增 HomeInfo 组件:居中标题 "Yggdrasil" + 简介
- 文章列表从第 1 篇开始显示(共 6 篇)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 10:46:18 +08:00
xfy
452e7d8312 实现博客首页(PaperMod 风格)
- Header: 顶部导航栏,Logo + 首页/归档/标签/搜索/关于 + 主题切换
- FirstEntry: 首篇文章精选区,大标题 + 完整摘要
- PostEntry: 文章卡片列表,圆角边框 + hover 上浮效果
- Pagination: 下一页按钮
- Footer: 版权信息 + 返回顶部按钮
- 6 篇中文占位文章数据

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 10:34:54 +08:00
xfy
8b3aab21de 恢复首页路由,添加归档/标签/搜索/关于路由占位
- router.rs: / 恢复为 HomePage,新增 /archives /tags /search /about
- mod.rs: 导出 home 模块
- theme.rs: ThemeToggle 从浮动按钮改为内联样式
- home.rs: 创建空占位文件

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 10:31:52 +08:00