123s
V2EX  ›  Hexo

hexo 是怎么玩的

  •  
  •   123s · Jun 27, 2016 · 3171 views
    This topic created in 3781 days ago, the information mentioned may be changed or developed.
    每次在本地写完,然后同步到 source 目录吗?然后它还有生成静态,你们是怎么写的。
    6 replies  •  2016-06-27 13:38:43 +08:00
    yangg
    yangg
    Jun 27, 2016
    1
    123s
    123s
    OP
    Jun 27, 2016
    2
    @yangg 意思是只同步 public 文件夹就可以了?
    如果我是写在 source ,每次还得重启 pm2
    sophymax
    sophymax
    Jun 27, 2016
    3
    必要的命令只有 hexo generate , 执行后自动把_posts 目录里的 md 生成 html 页面放到 public 目录了 , 再把 public 目录 git 提交上去 ,可以把相关命令放到一个脚本里
    123s
    123s
    OP
    Jun 27, 2016
    4
    @sophymax 现在就是用 pm2 启动脚本的。
    #!/bin/bash

    cd /root/www/blog/
    hexo generate --deploy
    hexo server -s

    我是否要加个 watch ?
    yangg
    yangg
    Jun 27, 2016
    5
    是只同步 public 就行了,你看看那些 deploy 插件
    hexo-deployer-rsync 是同步 public ,直接用 nginx 指到 public 就行了,不用重启什么
    还有 hexo-deployer-git 也可以
    123s
    123s
    OP
    Jun 27, 2016
    6
    @yangg 这样啊。那怎么备份呢?
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   5298 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 06:19 · PVG 14:19 · LAX 22:19 · JFK 01:19
    ♥ Do have faith in what you're doing.