Hexo 使用

hexo

1. 安装部署

npm install hexo-cli -g
hexo init blog
cd blog
npm install
# hexo s
hexo server

2. 使用 pm2 管理 hexo

  • 建立 pm2 脚本: vi hexo.sh
# pm2 脚本
hexo server
  • 启动: pm2 start hexo
  • 查看: pm2 list

hexo_pm2

3. theme:

3.1 marterial

3.2 Yelee

4. 使用图片

5. 编辑器 typora

6. nginx 支持

server {
listen 80;
server_name <server_name>;
autoindex on;
autoindex_exact_size off;
autoindex_localtime on;
index index.html index.htm;
access_log /pth/<>/access.log;
error_log /pth/<>/error.log;
location / {
proxy_pass http://127.0.0.1:4000;
}
}

7. 生成部署到 git

_config.yml

deploy:
type: git
repo: https://github.com/coghost/coghost.github.io
branch: master

命令

hexo g
hexo d
文章目录
  1. hexo
    1. 1. 安装部署
    2. 2. 使用 pm2 管理 hexo
    3. 3. theme:
      1. 3.1 marterial
      2. 3.2 Yelee
    4. 4. 使用图片
    5. 5. 编辑器 typora
    6. 6. nginx 支持
    7. 7. 生成部署到 git
      1. _config.yml
      2. 命令