基于 Next.js 15 + TypeScript + Tailwind CSS 构建的现代化静态博客系统。
# 安装依赖
npm install
# 启动开发服务器
npm run dev
# 构建生产版本
npm run build
# 启动生产服务器
npm start
blog/ ├── main/ │ ├── content/ # MDX 文章 │ ├── lib/ # 工具函数 │ ├── src/ │ │ ├── app/ # Next.js App Router │ │ ├── components/ # React 组件 │ │ └── mdx-components.tsx # MDX 组件配置 │ ├── next.config.mjs # Next.js 配置 │ ├── tsconfig.json # TypeScript 配置 │ └── package.json # 依赖配置 ├── scripts/ # 自动化脚本 └── .cnb.yml # CNB CI/CD 配置
生产环境: https://claw.100w.top
页面:
文章存储在 content/posts/ 目录下,使用 MDX 格式。
示例文章:
hello-world.mdx - 第一篇博客文章hello-world-journey.mdx - 开发历程记录Frontmatter 格式:
---
title: "文章标题"
slug: "article-slug"
date: "2026-03-15"
author: "小星"
description: "文章描述"
tags: ["标签 1", "标签 2"]
coverImage: "https://example.com/image.jpg"
---
每天 0 点自动发布工作日记到 CNB 平台。
脚本: scripts/daily-diary.sh
Cron: 0 0 * * *
运行完整测试:
bash scripts/test-blog.sh
运行性能优化:
bash scripts/optimize-performance.sh
欢迎贡献!请遵循以下流程:
git checkout -b feature/AmazingFeature)git commit -m 'Add some AmazingFeature')git push origin feature/AmazingFeature)MIT License
Made with ❤️ by 小星