===
Transform your plain text into static websites and blogs. gor is a Ruhoh like websites and blog generator engine written in Go. It's almost compatible to ruhoh 1.x specification. You can treat gor as a replacement of the official implementation what is written in Ruby.
Why reinvent a wheel? gor has following awesome benefits:
- Speed -- Less than 1 second when compiling all my near 200 blogs on wendal.net
- Simple -- Only one single executable file generated after compiling, no other dependence
==================== To install:
go get -u github.com/wendal/gor
go install github.com/wendal/gor/gor
If you use brew on Mac, and you didn't set $GOROOT
and $GOPATH
environment variable
Please using this command:
ln -s /usr/local/Cellar/go/1.0.3/bin/gor /usr/local/bin
Or to download a compiled one directly from googecodegor.zip
======================
gor new example.com
cd example.com
#After execution, a folder named example.com will be generated, including a scaffold & some sample posts.
gor post "goodday" [dir/to/img/files]
#generate a new post file: post/goodday.md, open it with your markdown editor to write.
dir/to/img/files
is optionl. If it's provided, all files in that dir will be copy into blog dir(configurable dir), and insert <img>
tag into post file.
Open the site.yml file in root folder
- Input title, author etc.
- Input email etc.
Open the config.yml file in root folder
- production_url is your website address, such as http://wendal.net, don't add '/' at last, it will be used to generate rss.xml etc.
- summary_lines is the length of abstract on homepage, any number as you like.
- latest is how many posts will be shown on homepage
imgs
parts is auto img config
Open widgets folder, you can see some widgets here, there is a config.yml file of each widget for configuration.
- analytics only support google analytics by now, please input tracking_id here
- comments only support disqus by now, please input your short_name of disqus here
- google_prettify for code highlighting, normally it's not necessary to change
gor compile
#Finished instantly. A new folder named compiled will be generated, all website is in it.
gor also comes with a built-in development server that will allow you to preview what the generated site will look like in your browser locally.
gor http
#Open your favorite web browser and visit: http://127.0.0.1:8080
You can deploy it to GitHub Pages, or put it to your own VPS, because there are only static files(HTML, CSS, js etc.), no need of php/mysql/java etc.
===
gor 是使用golang实现的类Ruhoh静态博客引擎(Ruhoh like),基本兼容ruhoh 1.x规范. 相当于与ruhoh的官方实现(ruby实现), 有以下优点:
- 速度完胜 -- 编译wendal.net近200篇博客,仅需要1秒
- 安装简单 -- 得益于golang的特性,编译后仅一个可运行程序,无依赖
==================== To install:
go get -u github.com/wendal/gor
go install github.com/wendal/gor/gor
在Mac下使用brew的用户
如果是通过brew来安装go
,并且没有设置$GOROOT
跟$GOPATH
的话,请使用如下命令
ln -s /usr/local/Cellar/go/1.0.3/bin/gor /usr/local/bin
或者你可以从googecode直接下载编译好的gor
======================
gor new example.com
#执行完毕后, 会生成example.com文件夹,包含基本素材及演示文章
cd example.com
gor post "goodday" [dir/to/img/files]
#即可生成 post/goodday.md文件, 打开你的markdown编辑器即可编写
如果输入可选参数 dir/to/img/files
,gor 会从该目录拷贝图片文件到配置的目录,同时在 goodday.md
中自动插入对应的 <img>
标签。
打开站点根目录下的site.yml文件
- 填入title, 作者等信息
- 填入邮箱等信息
打开站点根目录下的config.yml文件
- 设置production_url为你的网站地址, 例如 http://wendal.net 最后面不需要加入/ 生成rss.xml等文件时会用到
- summary_lines 首页的文章摘要的长度,按你喜欢的呗
- latest 首页显示多少文章
- imgs 部分为自动插入
<img>
相关的配置
打开widgets目录, 可以看到基本的挂件,里面有config.yml配置文件
- analytics 暂时只支持google analytics, 填入tracking_id
- comments 暂时只支持disqus, 请填入short_name
- google_prettify 代码高亮,一般不修改
gor compile
#瞬间完成,生成compiled文件夹,包含站点所有资源
gor http
#打开你的浏览器,访问 http://127.0.0.1:8080
你可以使用github pages等服务,或者放到你的自己的vps下, 因为是纯静态文件,不需要php/mysql/java等环境的支持
This project is licensed under the BSD license.
Copyright (C) 2013, by WendalChen wendal1985@gmail.com.
If you are also using gor, please don't hesitate to tell me by email or open an issue. 如果也在使用,欢迎email或者开个issue告诉我们哦