hexo-online-server

1.1.10 • Public • Published

hexo-online-server

本插件已实现以下功能:

  • 在线新建,编辑,删除post和page(默认路径)
  • hexo clean,hexo server,hexo deploy
  • 源码同步

需求

  • Node.js >= 10.0
  • Hexo 4.X(只测试了4.X)
  • Git
  • mac系统close server功能无法使用(我没有mac设备,无法测试)

准备工作

  • 源码托管到Git仓库(建议使用私人仓库)
  • 配置好git, 确认可以使用以下命令进行同步:
    • git pull
    • git add --all .
    • git commit -m "..."
    • git push

使用

安装

npm install hexo-online-server -S

配置

  1. 新建config.json文件, 内容如下:

    {
        "indexPath": "/", // , "/"
        "port": 4001, // http
        "wsPort": 4002, // websocke
        "secret": "", // session ID cookie,https://www.npmjs.com/package/express-session#secret
        "user": "", // 
        "passwordHash": "", // 
        "autoSave": 300000, // , :ms, 0
        "noticeUrl": "", // `+message`get
        "pull": ["git pull"], // git
        "push": ["git add --all .","git commit -m 'update'","git push"], // git
        "ssl": false, // SSL
        "private": { // ssl
            "key": "", // SSLkey
            "crt": "" // SSL
        }
    }

    上面的注释要删掉!

  2. config.json文件保存到你的博客目录以外的地方, 在_config.yml中添加:

    onlineConfigPath: '../config.json' #`config.json`文件路径
  3. 使用以下命令获取加密密码, 将得到的passwordHash添加到config.json文件:

    hexo bcrypt 你的密码
  4. 运行hexo online, 浏览器打开http://localhost:4001/

更多

示例

LICENSE

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i hexo-online-server

Weekly Downloads

2

Version

1.1.10

License

MIT

Unpacked Size

5.26 MB

Total Files

438

Last publish

Collaborators

  • hclonely