基础入门

基础命令

1
2
3
4
5
6
7
hexo help             # 帮助
hexo clean # 清除缓存和已生成的静态文件
hexo g # 生成页面
hexo s # 本地预览

hexo d # 部署
hexo g -d # 生成页面并部署

新建页面

1
hexo new page "name"  # 新建页面

创建文章

1
hexo new "name"       # 新建文章

Front-matter

Front-matter 选项中的所有内容均为非必填的。但我仍然建议至少填写 title 和 date 的值。

1
2
3
4
5
6
7
8
9
# 基本属性
title 文章标题
date 文件创建时间
updated 文件更新时间
author 文章作者
tags 文章标签
categories 文章分类
top true 设置为 true,文章则置顶
summary 开启文章摘要后,自定义文章摘要内容,否则截取文章内容为摘要
1
2
3
4
5
6
7
8
# 简单举例
---
title: Hello World
tags:
- Hello World
categories:
- Hello World
---

文章添加图片

1
2
3
4
5
6
7
8
9
10
11
12
13
14
# 修改根目录下的_config.yml文件开启配置 
post_asset_folder: true

# 创建文章之后会出现两个目录
hexo new page "name"

# 在name目录中进行引入图片

# 在name.md中进行引入图片
{% asset_img XXXX.XXX %}

替换
![image.png](./assets/ -> {% asset_img
.png) -> .png %}