🎉 Jekyll 迁移完成!
🎉 Jekyll 迁移完成!
✅ 已完成的工作
1. 创建的文件和目录
- ✅
_config.yml- Jekyll 配置 - ✅
Gemfile- Ruby 依赖管理 - ✅
_layouts/- 页面布局模板(default, home, post, page) - ✅
_includes/- 可复用组件(header, footer) - ✅
_posts/- 博客文章(已从 src/posts/ 迁移,共6篇) - ✅
assets/css/style.css- 简洁的GitHub风格样式 - ✅
assets/images/- 图片资源 - ✅
index.md- 首页 - ✅
about.md- 关于页面 - ✅
archive.md- 归档页面
2. 删除的文件和目录
- 🗑️
src/- Vue 源代码 - 🗑️
node_modules/- npm 依赖 - 🗑️
package.json- npm 配置 - 🗑️
vite.config.js- Vite 配置 - 🗑️
cypress/- E2E 测试 - 🗑️
dist/- 构建产物 - 🗑️
public/- Vue 静态资源 - 🗑️
docs/- VuePress 文档
🚀 下一步操作
1. 安装 Jekyll(首次使用需要)
1
2
3
4
5
# macOS
gem install jekyll bundler
# 如果遇到权限问题,使用:
sudo gem install jekyll bundler
2. 安装项目依赖
1
2
cd /Users/konglingran030521/Blog/scuklr.github.io
bundle install
3. 本地预览
1
2
3
4
bundle exec jekyll serve
# 或者带实时重载
bundle exec jekyll serve --livereload
然后访问:http://localhost:4000
4. 提交到 Git
1
2
3
4
5
6
7
8
9
10
11
# 查看修改
git status
# 添加所有文件
git add .
# 提交
git commit -m "Migrate from Vue to Jekyll"
# 推送到 GitHub
git push origin main
GitHub Pages 会自动识别 Jekyll 项目并构建!
🔄 如何回退到 Vue 版本
如果你想恢复到之前的 Vue 项目:
1
2
3
4
5
6
7
8
# 查看提交历史
git log --oneline
# 找到迁移前的 commit hash,然后:
git reset --hard <commit-hash>
# 例如:
# git reset --hard abc1234
📚 Jekyll 学习资源
- 官方文档: https://jekyllrb.com/
- 中文文档: https://jekyllcn.com/
- GitHub Pages: https://pages.github.com/
- Liquid 模板: https://shopify.github.io/liquid/
🎨 样式说明
当前使用的是简洁的 GitHub 风格样式,如果你想:
- 更换主题:修改
_config.yml中的theme配置 - 自定义样式:编辑
assets/css/style.css - 使用其他Jekyll主题:访问 http://jekyllthemes.org/
📝 写新文章
在 _posts/ 目录创建文件,命名格式:YYYY-MM-DD-title.md
1
2
3
4
5
6
7
8
---
title: 我的新文章
date: 2025-12-17
tags: ['技术', '学习']
description: 文章简介
---
文章内容...
保存后,Jekyll 会自动重新构建(如果使用了 –livereload)。
祝使用愉快!🎉