Total Pageviews

5,154,782

Wednesday, 25 December 2013

搭建基于ruby的静态博客程序serif

gem install serif
mkdir serif-site
cd serif-site
serif new

as3:~# gem install serif
as3:~# mkdir serif-site
as3:~# cd serif-site
as3:~/serif-site# ls
as3:~/serif-site# serif new
会显示:
cp -r archive.html /root/serif-site
cp -r _layouts /root/serif-site
cp -r _templates /root/serif-site
cp -r index.html /root/serif-site
cp -r _config.yml /root/serif-site
cp -r _drafts /root/serif-site
Beginning pre-process step for drafts.
Processing file: archive.html
Processing file: index.html
as3:~/serif-site# ls
archive.html  _drafts     _layouts  _site
_config.yml   index.html  _posts    _templates
as3:~/serif-site# ls _site
archive.html  drafts  index.html
as3:~/serif-site# cd _site
as3:~/serif-site/_site#
(可见:~/serif-site/_site/就是静态网站的根目录)

发贴方法:
as3:~/serif-site/_site# cd ../_posts
as3:~/serif-site/_posts# nano 2013-12-25-test1
as3:~/serif-site/_posts# cat 2013-12-25-test1
title: test1
Created: 2013-12-25T15:54:55

这是测试1.


然后:
as3:~/serif-site/_posts# cd ..
as3:~/serif-site# serif generate (这就是生成/更新静态网站的命令)

pls add the following into your apache's config file:
<VirtualHost ur-vps-ip:80>
ServerName serif.brite.biz
DocumentRoot /root/serif-site/_site
<Directory /root/serif-site/_site/>
            Options Indexes FollowSymLinks MultiViews
            AllowOverride All
            Order allow,deny
            allow from all
        </Directory>
</VirtualHost>

演示站点:http://serif.brite.biz/
项目地址:https://github.com/aprescott/serif/