Total Pageviews

Wednesday 1 January 2014

在linux vps上搭建只基于unix命令的静态博客程序-utterson

git clone git://github.com/stef/utterson.git
cd utterson
mkdir blog posts
cp cfg/utterson.cfg.example cfg/utterson.cfg
cp cfg/make.cfg.example cfg/make.cfg
echo "<p>Hello World</p>" > posts/first_post.html
apt-get install ksh
make -f Makefile.in liveposts Makefile
make
cd blog

as3:~/utterson/blog# ls
atom.xml  index.html  main.css  posts  sitemap.xml.gz  tags
as3:~/utterson/blog#
可见~/utterson/blog/就是静态网站的根目录。

发贴方法:
nano /root/utterson/posts/test1.html
格式为:
<p>这是测试1.</p>

然后,
编辑配置文件:
nano ~/utterson/cfg/make.cfg
(把里面的LIVESITE=www.example.com:/home/joe/public_html/blog改为
LIVESITE=urdomain.com:/root/utterson/blog)

编辑utterson.cfg
nano ~/utterson/cfg/utterson.cfg
(把里面的TVARS[BASEURL]="http://www.example.com/~user1/blog"改为
TVARS[BASEURL]="http://uts.brite.biz/")

as3:~/utterson/blog# cd ..
as3:~/utterson# make -f Makefile.in liveposts Makefile && make (这个就是更新静态网站的命令)

演示站点:http://uts.brite.biz/
项目地址:https://github.com/stef/utterson