as3:~# cd mygo
as3:~/mygo# go get github.com/dchest/kkr/
as3:~/mygo# go install github.com/dchest/kkr/
as3:~/mygo# cd ~
as3:~# git clone https://github.com/dchest/kkr
as3:~# cd kkr
as3:~/kkr# ls
assets filters layouts main.go README.md utils
example hashcache LICENSE metafile site
as3:~/kkr# find . -name site.yml
./example/site.yml
as3:~/kkr# cd example
as3:~/kkr/example# ls
assets assets.yml includes layouts pages posts site.yml
as3:~/kkr/example# kkr build (这个就是生成/更新静态网站的命令)
as3:~/kkr/example# ls
assets assets.yml includes layouts out pages posts site.yml
(新出现了out目录)
as3:~/kkr/example# cd out
as3:~/kkr/example/out# ls
about.html assets blog index.html lorem.txt markdown.html
as3:~/kkr/example/out#
可见~/kkr/example/out/就是静态网站的根目录。
as3:~/kkr/example/out# nohup Rwebserver 23461 > /dev/null &
访问http://as3.brite.biz:23461/就可看到网站效果。
发贴方法:
as3:~/kkr/example/out# cd ..
as3:~/kkr/example# ls
assets assets.yml includes layouts out pages posts site.yml
as3:~/kkr/example# cd posts
as3:~/kkr/example/posts# ls
2013-01-01-new-year.md 2013-10-18-kukuruz.html
as3:~/kkr/example/posts# nano 2014-03-05-test1.md
按2013-01-01-new-year.md的格式,新建帖子2014-03-05-test1.md,格式如下:
---
title: test1
tags: misc1, misc2
date: 2014-03-05T17:40:10-08:00
---
这是测试1.
注意:一定要加上此行 date: 2014-03-05T17:40:10-08:00 (-08:00表示跟格林威治时间相差8个小时),否则所发表的帖子是不会按时间顺序排列的。trofaf这个程序也是一样的情况
(http://briteming.blogspot.co.uk/2014/02/linux-vpsgo-trofaf.html)
然后,
as3:~/kkr/example/posts# cd ..
as3:~/kkr/example# ls
assets assets.yml includes layouts out pages posts site.yml
as3:~/kkr/example# kkr build
演示站点:http://as3.brite.biz:23461/blog/,http://kkr.bright.za.net
项目地址:https://github.com/dchest/kkr