V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
123s
V2EX  ›  Hexo

hexo 是怎么玩的

  •  
  •   123s · 2016-06-27 09:43:26 +08:00 · 2339 次点击
    这是一个创建于 2853 天前的主题,其中的信息可能已经有所发展或是发生改变。
    每次在本地写完,然后同步到 source 目录吗?然后它还有生成静态,你们是怎么写的。
    6 条回复    2016-06-27 13:38:43 +08:00
    yangg
        1
    yangg  
       2016-06-27 10:05:06 +08:00
    123s
        2
    123s  
    OP
       2016-06-27 12:12:31 +08:00
    @yangg 意思是只同步 public 文件夹就可以了?
    如果我是写在 source ,每次还得重启 pm2
    sophymax
        3
    sophymax  
       2016-06-27 12:18:59 +08:00
    必要的命令只有 hexo generate , 执行后自动把_posts 目录里的 md 生成 html 页面放到 public 目录了 , 再把 public 目录 git 提交上去 ,可以把相关命令放到一个脚本里
    123s
        4
    123s  
    OP
       2016-06-27 12:23:09 +08:00
    @sophymax 现在就是用 pm2 启动脚本的。
    #!/bin/bash

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

    我是否要加个 watch ?
    yangg
        5
    yangg  
       2016-06-27 12:47:22 +08:00
    是只同步 public 就行了,你看看那些 deploy 插件
    hexo-deployer-rsync 是同步 public ,直接用 nginx 指到 public 就行了,不用重启什么
    还有 hexo-deployer-git 也可以
    123s
        6
    123s  
    OP
       2016-06-27 13:38:43 +08:00
    @yangg 这样啊。那怎么备份呢?
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3097 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 10:58 · PVG 18:58 · LAX 03:58 · JFK 06:58
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.