hexo基本命令汇总

Hexo官网

Hexo官方文档

问题解答

GitHub

快速开始

ubuntu下安装

1.安装git(略)

2.安装nvm(https://github.com/nvm-sh/nvm)

Git Install
If you have git installed (requires git v1.7.10+):

clone this repo in the root of your user profile

1
2
cd ~/ from anywhere then git clone https://github.com/nvm-sh/nvm.git .nvm
cd ~/.nvm and check out the latest version with git checkout v0.37.2

之后把下面的文本插入到~/.bashrc

1
2
3
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion

输入command -v nvm可确认nvm安装完成

3.安装nodejs

1
nvm install node

4.设置 淘宝镜像代理

1
2
3
4
5
6
7
8
9
10
获取当前 npm 代理
npm get registry
返回结果:
https://registry.npmjs.org/

设置淘宝镜像代理
npm config set registry http://registry.npm.taobao.org/

恢复 npm 代理
npm config set registry https://registry.npmjs.org/

5.安装hexo

‵‵`
npm install -g hexo-cli

1
2
3
4
5
6


### 新建一个post

``` bash
$ hexo new "title"

本地运行

1
$ hexo s

生成静态网页

1
$ hexo g

上传

1
$ hexo d

出现问题?

事先要输入npm install安装必备的组件(重要)

如果依然有问题百度搜索一下出现的问题,多半能得到答案

-------------end-------------
  • 本文作者: ouyen
  • 本文链接: https://ouyen.github.io/hexo/
  • 版权声明: 本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!