Total Pageviews

Sunday, 9 February 2014

在linux vps上搭建基于go的静态博客程序-jedie

cd ~/mygo
go get github.com/mattn/jedie
cd ~
(或者直接在~下,进行如下操作:
git clone https://github.com/mattn/jedie
cd jedie
go get github.com/flosch/pongo
go get github.com/howeyc/fsnotify
go get github.com/russross/blackfriday
go get launchpad.net/goyaml
go build
cd ~ )

as3:~# mkdir jedie-site
as3:~# jedie new jedie-site
as3:~# ls jedie-site
_config.yml  css  index.html  _layouts  _posts  rss.xml
as3:~# cd jedie-site
as3:~/jedie-site# jedie build (这个就是生成/更新静态网站的命令)
as3:~/jedie-site# ls
_config.yml  css  index.html  _layouts  _posts  rss.xml  _site
(新出现了_site目录)
as3:~/jedie-site# cd _site
as3:~/jedie-site/_site# ls
2014  css  index.html  rss.xml
as3:~/jedie-site/_site#
可见~/jedie-site/_site/就是静态网站的根目录。
as3:~/jedie-site/_site# nohup Rwebserver 34830 > /dev/null &
访问http://as3.brite.biz:34830/,即可看到网站效果。

发贴方法:
as3:~/jedie-site/_site# cd ..
as3:~/jedie-site# ls
_config.yml  css  index.html  _layouts  _posts  rss.xml  _site
as3:~/jedie-site# cd _posts
as3:~/jedie-site/_posts# ls
2014-02-09-welcome-to-jedie.md
as3:~/jedie-site/_posts# nano 2014-02-09-test1.md
按2014-02-09-welcome-to-jedie.md的内容格式,新建帖子2014-02-09-test1.md,
格式如下:
---
layout: post
title:  test1
date:   2014-02-09 18:23:47
---

这是测试1.

然后,
as3:~/jedie-site/_posts# cd ..
as3:~/jedie-site# jedie build

演示站点:http://as3.brite.biz:34830/,www.brite.biz
项目地址:https://github.com/mattn/jedie