H2OBJECT 同 hexo, hugo 一样是一个通过 markdown 文件快速创建内容型站点的工具。不同的是, H2OBJECT 参考了 Docker Pull/Push 的方式实现快速本地到线上站点的一键发布。
同时, 用户可以申请h2object.io平台提供的仅运行h2obect应用的docker容器运行线上站点.
如果你无法直接源码安装或者不想被GFW扰乱心绪, 就直接下载可执行程序吧:
解压后,将 h2object 放入系统执行路径中。
$: go get github.com/h2object/h2object
虽然已经竭尽全力减少对墙外包的依赖, 国内安装还是得提前做些准备工作:
由于项目中使用了以下两个国内绝对不能直接go get 的依赖包。
- golang.org/x/net
- golang.org/x/text
- golang.org/x/image
请在 GOPATH 目录下创建相应目录:
mkdir -p $GOPATH/src/golang.org/x
cd $GOPATH/src/golang.org/x
git clone https://github.com/golang/net.git
git clone https://github.com/golang/text.git
git clone https://github.com/golang/image.git
$: h2object -w=/path/to/workdir http start
$: h2object theme search
下载他人分享的站点主题
$: h2object -w=/path/to/workdir theme pull [provider/name:version]
将个人站点主题分享给其他用户,请先在配置文件中配置好[theme]项
$: h2object -w=/path/to/workdir theme push
- 创建容器
容器创建前必须到h2object.io平台申请容器邀请码。
$: h2object -w=/path/to/workdir container create [邀请码]
- 运行容器
$: h2object -w=/path/to/workdir container start [container id]
将容器提供的appid,secret,host,port配置到本地发布站点的[deploy]配置项中
[deploy]
# 远端部署服务 域名 或 地址
host= h2object.io
# 远端部署服务 端口
port= 80
# 远端应用ID
appid=
# 远端应用密钥
secret=
再通过以下命令一键发布站点
$: h2object -w=/path/to/workdir deploy push
非常欢迎您使用并推荐 H2OBJECT 项目。