Skip to content

feat: 博客从 Hexo 迁移到 Astro + AstroPaper - #24

Merged
xkcoding merged 16 commits into
masterfrom
feature/migrate-to-astro
Jan 16, 2026
Merged

xkcoding merged 16 commits into
masterfrom
feature/migrate-to-astro

Conversation

@xkcoding

@xkcoding xkcoding commented Jan 15, 2026

Copy link
Copy Markdown
Owner

Summary

将博客从 Hexo 迁移到 Astro + AstroPaper 主题,主要改动包括:

  • 框架迁移: Hexo → Astro 5.x + AstroPaper 模板
  • 内容处理: 89 篇文章迁移,15 篇归档,全部生成语义化描述
  • UI 优化: 文章导读卡片、首页布局优化、代码块样式增强
  • 中文本地化: 界面文案、日期格式全面中文化
  • 设计系统: 新 Logo/Favicon、配色方案优化
  • CI/CD: GitHub Actions 自动部署到 GitHub Pages

迁移清单

  • Astro 项目初始化与配置
  • 文章内容迁移(89 篇保留,15 篇归档)
  • 文章语义化描述生成
  • 导读卡片 UI 实现
  • 中文本地化
  • Logo/Favicon 设计
  • CI/CD 配置
  • 性能测试(Lighthouse)
  • 旧 URL 重定向

Test plan

  • 本地构建测试通过 (pnpm build)
  • 代码块高亮正常
  • 深色模式切换正常
  • 搜索功能正常
  • RSS 订阅正常
  • 移动端响应式验证
  • Lighthouse 性能测试

🤖 Generated with Claude Code

柏玄(沈扬凯) and others added 3 commits January 15, 2026 17:05
- Replace Hexo 3.9.0 with Astro 5.x
- Use AstroPaper theme for minimal, accessible design
- Migrate 74 articles, archive 15 outdated articles
- Configure GitHub Actions for CI/CD
- Add Pagefind search support
- Update site config for xkcoding.com

BREAKING CHANGE: URL structure changed from /:year/:month/:day/:title.html to /posts/:slug/

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Mark Phase 0-5 tasks as completed
- Update migration statistics (74 keep, 15 archive)
- Note items requiring post-deployment verification

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- 将标题从 Mingalaba 改为 CodingDiary
- 添加中文个人简介
- 更新导航链接为中文(全部文章、关于我)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings January 15, 2026 09:11

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR migrates the blog from Hexo 3.9.0 to Astro 5.x with the AstroPaper theme, modernizing the tech stack and improving performance. The migration includes 74 posts, archives 15 outdated articles, and sets up automated deployment via GitHub Actions.

Changes:

  • Replaced Hexo static site generator with Astro 5.x framework and AstroPaper 5.5.1 theme
  • Migrated 74 blog posts from Hexo front matter format to Astro content collections with updated metadata schema
  • Removed entire Hexo theme infrastructure and replaced with modern Astro components and utilities

Reviewed changes

Copilot reviewed 240 out of 873 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
themes/landscape/* Removed entire Hexo Landscape theme (CSS, layouts, scripts, config)
src/content.config.ts Added Astro content collection schema for blog posts
src/config.ts Added site configuration for AstroPaper theme
src/components/* Added new Astro UI components (Header, Footer, Card, etc.)
src/layouts/* Added Astro layout templates for pages and posts
src/pages/* Added Astro page routes and API endpoints
src/utils/* Added utility functions for post filtering, slugification, and OG image generation
src/data/blog/* Migrated and updated blog post front matter from Hexo to Astro format
source/* Removed Hexo source files and legacy content

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

permalink: helloworld
top:
- helloworld
description: "Welcome to Hexo: This is your very first post.\" "

Copilot AI Jan 15, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Corrected escaped quote: the description has an unnecessary backslash before the closing quote. Should be \"Welcome to Hexo: This is your very first post.\"

Suggested change
description: "Welcome to Hexo: This is your very first post.\" "
description: "Welcome to Hexo: This is your very first post."

Copilot uses AI. Check for mistakes.
柏玄(沈扬凯) and others added 13 commits January 15, 2026 17:21
## CI 修复
- 移除 workflow 中的 pnpm 版本指定,使用 package.json 中的版本

## 标签优化
第一轮优化(14 篇文章):
- reading → 阅读笔记(统一中文)
- 源码探索 → 源码分析
- ci/gitlab/jenkins/vagrant → devops
- k3d/k3s/minikube → kubernetes
- 多线程 → java
- 翻译 → 技术翻译

第二轮优化(6 篇文章):
- maven/lombok/mapstruct/quartz/jfinal → java
- scaffold → 开源
- regex → 代码片段

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- 删除不再需要的迁移脚本
- 移除 constants.ts 中未使用的 IconLinkedin 导入

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
主要变更:
- 添加代码块语言标签显示功能,修复与复制按钮重叠问题
- 全站中文本地化(导航、按钮、日期格式、分享链接等)
- 优化 Footer 布局,添加 ICP 备案信息
- 文章列表添加摘要显示功能
- 优化 SVG 图标亮暗模式适配
- 文章 URL 格式从 /posts/slug 改为 /slug
- 优化面包屑、标签等组件样式

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
主要改动:
- 为 2017-2022 年所有文章生成语义化描述
- 新增文章详情页导读卡片样式
- 更新首页卡片布局与样式优化
- 优化 RSS 输出格式
- 更新 favicon 和 Logo 图标
- 新增 Firecrawl 文章
- 归档 refine-design-system proposal
- 更新迁移任务状态

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- 移除 Footer.astro 未使用的 Socials 导入
- 移除 index.astro 中的 console.log
- ESLint 忽略 hexo-backup 和 openspec 目录

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
提交前自动运行 Prettier 格式化代码

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@xkcoding
xkcoding merged commit da2d666 into master Jan 16, 2026
1 check passed
@xkcoding
xkcoding deleted the feature/migrate-to-astro branch January 16, 2026 03:24
xkcoding added a commit that referenced this pull request Jan 16, 2026
feat: 博客从 Hexo 迁移到 Astro + AstroPaper
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants