「学」 Hexo

本文最后更新于:40 分钟前

Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub.

Quick Start

创建新网站

1
$ hexo init

创建新文章

1
$ hexo new "title"

More info: Writing

创建新页面

1
$ hexo new page "title"

清除缓存文件

1
$ hexo clean

在本地启动 hexo

1
$ hexo server

More info: Server

生成静态文件

1
$ hexo generate

More info: Generating

部署到 Github

1
$ hexo deploy

More info: Deployment

更换电脑

hexo 目录下的文件和 github 上的文件是不同的,public 文件夹的文件通过 hexo d 上传到 github,其他的文件则留在本地目录下。

  1. 将本地文件传入 github 新建分支 hexo,并设为默认。
  2. 在新电脑上克隆新分支到本地,切换到 username.github.io 目录,执行 npm install 安装依赖(node_modules文件)。
  3. 安装 hexo: npm install -g hexo-cli,安装必要的插件,例如需要部署到 gitPage: npm install hexo-deployer-git --save
  4. 更改后依次执行 git add .git commit -m "..."git push
  5. 更新前使用 git pull

.md 文件建议使用 UTF-8,其他格式可能会乱码。


「学」 Hexo
https://qanlyma.github.io/Note-Hexo/
作者
Qanly
发布于
2022年11月7日