基于 Astro + Tailwind CSS 构建的现代化个人博客。
- 🌙 深色/浅色主题切换
- 🔍 全文搜索 (Fuse.js)
- 📰 RSS 订阅
- 🗺️ 网站地图 (SEO)
- 🏷️ 标签分类
- 💬 Giscus 评论
- 📱 响应式设计
# 安装依赖
npm install
# 启动开发服务器
npm run dev
# 构建生产版本
npm run build
# 预览构建结果
npm run preview-
创建一个新的 GitHub 仓库 (例如
blog) -
推送代码到仓库:
git init git add . git commit -m "Initial commit" gh repo create blog --public --source=. --push
-
仓库已配置 GitHub Actions,会自动部署
-
在仓库设置中启用 GitHub Pages:
- Settings → Pages → Source: GitHub Actions
-
访问
https://tyd5630.github.io/blog
npm run build
# 将 dist 目录内容推送到 gh-pages 分支
npx gh-pages -d dist在 src/content/blog/ 目录下创建 .md 文件:
---
title: '文章标题'
description: '文章描述'
pubDate: 2026-03-12
heroImage: 'https://example.com/image.jpg'
tags: ['标签1', '标签2']
---
# 内容- 前往 https://giscus.app
- 授权并选择你的 GitHub 仓库
- 获取
repo-id和category-id - 修改
src/layouts/BlogPost.astro中的配置
MIT License