123s
V2EX  ›  Hexo

hexo 是怎么玩的

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

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

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