# hexo 常用指令

# New

# 创建文章

$ hexo new [layout] <title>

新建一篇文章。 如果没有设置  layout  的话,默认用 _config.yml 中的  default_layout  参数代替。

也就是说,在不使用 layout 时,可以省略

只写文章标题就行

例如 hexo new aboutMysite

就会在 source/_posts 文件夹中创建 aboutMysite.md 文件

如果标题包含空格的话,请使用引号 “” 括起来。

# 创建分类 categories

$ hexo new page categories

source/categories 文件夹中创建一个 index.md 文件

打开 index.md 文件后

在里面里面添加 type: categories

title: 分类的名字
date: 2024-7-27 18:00:00
type: categories

# Clean

清除缓存文件(db.json)和已生成的静态文件(public)

一般是网站改动较大时,需要 clean ,然后再生成静态文件

$ hexo clean

# Server

启动服务器。 默认情况下,访问网为:  http://localhost:4000/

$ hexo s

# Generate

生成静态文件

$ hexo g

# Deploy

部署站点,在本地生成 .deploy_git 文件夹,并将编译后的文件上传至 GitHub。

$ hexo d

# Backup and Migration

1. 备份根目录

2. 重新安装 hexo

3. 使用备份覆盖 hexo 的目录

4.clean 后 generate,然后 server 和 deploy

Edited on

Give me a cup of [coffee]~( ̄▽ ̄)~*

Yayaccc WeChat Pay

WeChat Pay

Yayaccc Alipay

Alipay