本项目是基于Hexo 8.0.0的博客框架,已配置好基本的运行环境。
当前主题: 🌸 hexo-theme-reimu v1.12.0(博丽灵梦风格主题)
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
cd /workspace/blog
./start-reimu.sh
或使用传统方式:
cd /workspace/blog
hexo clean && hexo g && hexo s
hexo new "文章标题"
文章会创建在 source/_posts/ 目录下。
hexo generate
# 或简写为
hexo g
生成的静态文件在 public/ 目录。
hexo deploy
# 或简写为
hexo d
blog/ ├── _config.yml # Hexo主配置文件 ├── _config.landscape.yml # 主题配置文件 ├── package.json # 项目依赖配置 ├── scaffolds/ # 文章模板 │ ├── draft.md # 草稿模板 │ ├── page.md # 页面模板 │ └── post.md # 文章模板 ├── source/ # 源文件目录 │ ├── _posts/ # 文章目录 │ │ └── hello-world.md │ └── _drafts/ # 草稿目录(如存在) ├── themes/ # 主题目录 │ └── landscape/ # 默认主题 └── public/ # 生成的静态文件(生成后创建)
| 命令 | 说明 |
|---|---|
hexo n "文章名" | 新建文章 |
hexo clean | 清理缓存和生成的文件 |
hexo g | 生成静态文件 |
hexo s | 启动本地服务器 |
hexo d | 部署到远程服务器 |
hexo publish "草稿名" | 发布草稿 |
编辑 _config.yml 文件:
title: 你的博客标题
subtitle: 副标题
description: 博客描述
author: 作者名
language: zh-CN # 语言设置为中文
timezone: Asia/Shanghai # 时区设置为上海
当前使用 hexo-theme-reimu 主题(博丽灵梦风格)。
主题配置文件位于 themes/hexo-theme-reimu/_config.yml。
详细配置请查看:REIMU_THEME_GUIDE.md
如果需要更换主题:
themes/ 目录安装新主题_config.yml 中的 theme 字段解决方案:
npm install --registry=https://registry.npmmirror.com
修改 _config.yml 中的端口配置,或在启动时指定端口:
hexo server -p 4001
确保文章使用正确的Front Matter格式:
---
title: 文章标题
date: 2026-01-28 14:00:00
tags: [标签1, 标签2]
categories: 分类
---
文章内容...
# 清理缓存后重新生成
hexo clean
hexo generate
确保图片路径正确,建议将图片放在 source/images/ 目录下:

npm install hexo-generator-searchdb
npm install hexo-generator-feed
npm install hexo-generator-sitemap
npm install hexo-neat
npm install hexo-deployer-git --save
编辑 _config.yml:
deploy:
type: git
repo: https://github.com/username/username.github.io.git
branch: main
hexo clean hexo g hexo d
---
title: 文章标题
date: 2026-01-28 14:00:00 # 创建时间
updated: 2026-01-28 15:00:00 # 更新时间
comments: true # 是否开启评论
tags: [标签1, 标签2]
categories: 分类
permalink: 自定义链接
---
\`\`\`javascript
console.log('Hello Hexo!');
\`\`\`

现在你可以开始创建你的第一篇博客了:
hexo new "我的第一篇博客"
编辑 source/_posts/我的第一篇博客.md 文件,然后:
hexo clean hexo g hexo s
访问 http://localhost:4000 查看你的博客!
祝写作愉快! 📝✨