Hexo 的常用操作
Hexo 博客速查手册
设备:HK1 Box / Vontar X3 (192.168.1.5)
域名:https://moonward.me
博客目录:/opt/hexo-blog
Git 仓库:http://192.168.1.8:30001/wave/hexo-blog.git
一、博客结构速查
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| /opt/hexo-blog/ ├── _config.yml <- 博客主配置(标题、作者、URL等) ├── scaffolds/ │ ├── post.md <- 新建文章模板 │ ├── draft.md <- 新建草稿模板 │ └── page.md <- 新建页面模板 ├── source/ <- 文章、页面、图片(纳入git) │ ├── _posts/ <- 已发布文章 │ ├── _drafts/ <- 草稿 │ ├── about/ <- 关于页面 │ ├── img/ <- 图片资源 │ └── ... <- 其他自定义页面 ├── themes/butterfly/ <- Butterfly主题 ├── package.json <- 依赖清单 ├── public/ <- 生成的静态文件(不纳入git) └── node_modules/ <- npm包(不纳入git)
|
二、常用命令
文章管理
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| cd /opt/hexo-blog
hexo new post "文章标题"
hexo new draft "草稿标题"
hexo publish draft "草稿标题"
hexo new page "about"
|
生成与预览
1 2 3 4 5 6 7 8 9 10 11 12 13
| cd /opt/hexo-blog
hexo generate
hexo server
hexo clean && hexo generate
|
图片引用
图片放在 source/img/ 下:
