Panda Wiki

Hexo 环境部署与发布

本地安装 Hexo

安装 node.js

sudo apt-get install nodejs

安装 npm

sudo apt install npm

更新 npm

npm update -g

npm 更换为国内源

npm config set registry https://registry.npm.taobao.org

更新 node.js

sudo npm install -g n
sudo n latest

安装 Hexo

sudo npm install -g hexo-cli

部署到远端

Git

npm install hexo-deployer-git --save

配置站点 _config.yml

deploy:
  type: git
  repo: <repository url>
  branch: [branch]
  message: [message]

SFTP

npm install hexo-deployer-sftp --save

配置站点 _config.yml

deploy:
  type: sftp
  host: <host>
  user: <user>
  pass: <password>
  remotePath: [remote path]
  port: [port]
  privateKey: [path/to/privateKey]
  passphrase: [passphrase]
  agent: [path/to/agent/socket]
Copyright © 2020 熊猫小A Views